DRAG DROP
You are developing an application that will include a method named GetDat
a. The GetData() method will retrieve several lines of data from a web service by using a
System.IO.StreamReader object.
You have the following requirements:
The GetData() method must return a string value that contains the entire response from the web
service.
The application must remain responsive while the GetData() method runs.
You need to implement the GetData() method.
How should you complete the relevant code? (To answer, drag the appropriate objects to the
correct locations in the answer area. Each object may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.)

When trying to pass the exam, I was really confused about the empty space in front of “await”. Since “await await” is not a valid construct in C#, I left it empty during my exam and I fear that was a bad idea.
Anyone has an idea if this field should be kept blank or not to pass this question successfully?
0
0
hey Hans did you clear your exam with this question can you help me.
0
0
news about this question? maybe it’s a wrong past/copy but the fields needs to be completed with async, await, readtoend() anyway!
0
0
It not wrong.
The first await returns a Task and by adding the second await in front of it, the result will be string.
0
0
ReadToEndAsync() returns Task
the first “await” returns string. The second await causes error “string doesn’t contain a definition for GetAnswer ….”.
So no need to put 2nd “await”
0
0
1-async
2-await
3-ReadLineAsync
2
3
Are you sure ?
“The GetData() method will retrieve several lines of data from a web service by using a
System.IO.StreamReader object.”
Do we need to use ReadToEndAsync() when reading several lines ?
3
1