In .NET, what should an async method that produces no result usually return?
Correct answer
C. Task
18 views
C. Task
18 views
Returning Task lets callers await the method and catch its exceptions. async void should be used only for event handlers, because its errors cannot be awaited or caught by the caller.
Asked in: NTS, Technical Interviews
Not sure why the answer is C? Ask here and get an explanation.