If an async method is declared as async Task GetCountAsync(), what type does await GetCountAsync() produce?
Correct answer A. int
Explanation
Awaiting a Task unwraps it, so the expression await GetCountAsync() has type int once the task completes. Inside the method, you write return 5; and the compiler wraps the value in the task. If the task faults, await rethrows the original exception. A plain Task represents an operation with no result, so awaiting it produces no value.
Answer checked How we write and check questions
Discussion