PrepAway - Latest Free Exam Questions & Answers

You need to create a query expression to display all of the grades for students whose first name is "John

You are developing an application in Visual Studio 2012 to display student information. The application
contains the following Entity Framework model.

The application contains a WCF data service named DirectoryService.svc.
You need to create a query expression to display all of the grades for students whose first name is
“John”
How should you build the expression?

PrepAway - Latest Free Exam Questions & Answers

A.
http://localhost:54946/DirectoryService.svc/Students?$filter=FirstName eq ‘John’ &$expand=Grades

B.
http://localhost:54946/DirectoryService.svc/Students?$filter=FirstName eq ‘John’/Grades

C.
http://localhost:54946/DirectoryService.svc/Students?$filter=FirstName = ‘John’ &$expand=Grades

D.
http://localhost:54946/DirectoryService.svc/Grades/Students?$filter=FirstName eq ‘John’

6 Comments on “You need to create a query expression to display all of the grades for students whose first name is "John

      1. Andrey B says:

        Why A?
        I think D.

        Quote from ‘Ryan W. Exam Ref 70-487’:
        “As long as there are relationships defined in the Entity Model, you can use a few different semantics to return related entities.

        Change things up and assume (just for review) that you want to return the Question entity with a key value of “1” and you want just the QuestionText property:
        http://servicehost/ExamPrepService.svc/Questions('1‘)/QuestionText
        That would give you the Question text, but what if you wanted the Answers to it? You would use:
        http://servicehost/ExamPrepService.svc/Questions('1‘)/Answers
        You can work it the other way around, too, of course. If you want the Question that corresponded to an Answer entity with a key of (‘1:4’):
        http://servicehost/ExamPrepService.svc/Answers('1:4‘)/Question”




        0



        0
  1. maverickcalibre says:

    Answer is
    A. http://localhost:54946/DirectoryService.svc/Students?$filter=FirstName eq ‘John’ &$expand=Grades

    https://www.odata.org/documentation/odata-version-2-0/uri-conventions/

    The syntax of a $expand query option is a comma-separated list of Navigation Properties. Additionally each Navigation Property can be followed by a forward slash and another Navigation Property to enable identifying a multi-level relationship.




    0



    0

Leave a Reply