PrepAway - Latest Free Exam Questions & Answers

How should you complete the relevant code?

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.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

7 Comments on “How should you complete the relevant code?

  1. Hans Werner says:

    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
      1. ivannathan says:

        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. Zag says:

      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

Leave a Reply