exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 119 discussion

Actual exam question from Microsoft's 70-487
Question #: 119
Topic #: 1
[All 70-487 Questions]

DRAG DROP -
You are developing a WCF Data Services service in Visual Studio to display movie information from a SQL Server database that changes every 24 hours. The service is defined in the following class.

The application contains the following Entity Framework model.

The service must only return data for movies that are currently in theaters.
You need to add a method to the MovieService class to filter the data.
You have the following code:

Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code? To answer, drag the appropriate code segments to the correct targets in the answer area. Each code segment 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.
Each correct selection is worth one point.
NOTE:
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: QueryInterceptor -
[QueryInterceptor( EntitySetName )]
Methods with the QueryInterceptorAttribute attribute applied are called when an HTTP GET request is received for the targeted entity set resource. These methods must always return a lambda expression in the form of Expression<Func<T,bool>>.
Box 2: "MovieEntities"

Box 3: Expression -
Example code:
// Define a query interceptor for the Orders entity set.
[QueryInterceptor("Orders")]
public Expression<Func<Order, bool>> OnQueryOrders()
Incorrect Answers:
ChangeInterceptor: Methods with the ChangeInterceptorAttribute attribute applied are called when an HTTP request other than HTTP GET request is received for the targeted entity set resource. These methods must always return void (Nothing in Visual Basic).
References:
https://docs.microsoft.com/en-us/dotnet/framework/data/wcf/interceptors-wcf-data-services

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
dalisaacs
Highly Voted 5 years, 5 months ago
Box2: Movies
upvoted 39 times
course104
4 years, 3 months ago
MSDN: // Define a query interceptor for the Orders entity set. [QueryInterceptor("Orders")] public Expression<Func<Order, bool>> OnQueryOrders()
upvoted 1 times
...
...
supersunny
Highly Voted 5 years, 2 months ago
Movies
upvoted 8 times
...
nnvuf
Most Recent 4 years, 3 months ago
Box2: should be Movies https://docs.microsoft.com/en-us/dotnet/api/system.data.services.queryinterceptorattribute?view=netframework-4.8
upvoted 1 times
...
kvijen
4 years, 5 months ago
I think ORM class name is MovieEntities so answer is correct. QueryIntercetor MovieEntities Expression
upvoted 1 times
piedro
4 years, 5 months ago
".SetEntitySerAccessRule("Movies")". EntitySet name is Movies. Doenst this mean Box 2 should be Movies?
upvoted 2 times
...
PrepX
4 years, 5 months ago
The code "DataService<MovieEntities>" implies that the data model is named "MovieEntities", whereas the entity set is "Movies" as mentioned by piedro. see example with "NorthwindEntities": https://docs.microsoft.com/en-us/dotnet/framework/data/wcf/creating-the-data-service#create-the-wcf-data-service
upvoted 1 times
...
...
tanujgyan
4 years, 10 months ago
Same as question 3. Box 2 should be Movies
upvoted 6 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago