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:
shouldn’t it be
Select
Where
=>
==
???
K.. got it, it’s Select, Any.
Because the where clause would return the orders (and its not compared to anything).
Otherwise with Any, it would return true if there’s at least one order.
Correct Answer
Where
Any
=>
==
Any(…) returns one object
Any(…) returns BOLEAN
Correct!