You are developing an application that uses multiple asynchronous tasks to optimize performance.
The application will be deployed in a distributed environment.
You need to retrieve the result of an asynchronous task that retrieves data from a web service.
The data will later be parsed by a separate task.
Which code segment should you use?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
B
1
1
A.
Task is already asyncronous, so no need to add one more async/await.
You can get result from Task in few ways – waiting for it (.Wait() ot await) OR get Task.Result value.
the answer B works, bu it requires redundant async/await in GetData()
0
0