exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 137 discussion

Actual exam question from Microsoft's 70-483
Question #: 137
Topic #: 2
[All 70-483 Questions]

DRAG DROP -
You have a class named Customer and a class named Order.
The customer class has a property named Orders that contains a list of Order objects.
The Order class has a property named OrderDate that contains the date of the Order.
You need to create a LINQ query that returns all of the customers who had at least one order during the year 2005.
You write the following code.

How should you complete the code? To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

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
user123
Highly Voted 5 years, 8 months ago
It should be: Where Any => ==
upvoted 36 times
...
Asa
Highly Voted 5 years, 11 months ago
6, 3, 2, 1
upvoted 13 times
JoelChuca
4 years, 9 months ago
Agree. the requirenment is "... at least one order" that represents Any
upvoted 1 times
...
...
noussa
Most Recent 4 years, 5 months ago
It should be Any() for target 2 List<Customer> result = list.Where(c => c.Orders.Any( o => o.OrderDate.Year == 2005)).ToList();
upvoted 2 times
...
sscooter1010
5 years, 4 months ago
This code compiles and produces the intended result: List<Customer> result = list.Where(c => c.Orders.Any( o => o.OrderDate.Year == 2005)).ToList();
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 ...