exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 91 discussion

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

DRAG DROP -
You are developing a web application by using Microsoft ASP.NET MVC.
The application manages company employees and managers.
Each employee is assigned to a manager.
You need to write a LINQ query to retrieve the list of managers and their respective employees.
How should you complete the code? To answer, drag the appropriate keywords to the correct targets. Each keyword 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:
Reference:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/basic-linq-query-operations

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
MJKWandile
Highly Voted 5 years, 6 months ago
the second block should be "on" instead of "in"
upvoted 29 times
MJKWandile
5 years, 6 months ago
https://www.c-sharpcorner.com/article/sql-join-query-with-linq/
upvoted 5 times
...
...
nfgmaia
Highly Voted 5 years, 5 months ago
Also, a typo in the second line: "managers" should be "manager".
upvoted 10 times
elathir
4 years, 7 months ago
No, if there was a manager then the correct answer would by on for the second statement, but it's managers on purpose and in this case in is correct answer. It's correct but I never saw in my life someone using this form, people are used to the one based on "on".
upvoted 1 times
ArnoudBM
4 years, 3 months ago
Tried to use the keyword IN in Linqpad, using the example from https://docs.microsoft.com/en-us/dotnet/csharp/linq/perform-inner-joins#example---inner-join-by-using-grouped-join: compiler error CS0743 Expected contextual keyword 'on'. So definitely not IN but ON. Using same method verified its manager, not managers.
upvoted 1 times
...
...
...
kvijen
Most Recent 4 years, 5 months ago
FROM manager in managers JOIN employee in employees ON manager EQUALS employee.manager SELECT new (ManagerName = manager.FirstName, EmployeeName = employee.Name);
upvoted 5 times
...
ShahAli
4 years, 10 months ago
2nd block on
upvoted 2 times
...
Code_Black
5 years, 3 months ago
correct ans: 2nd block : "on"
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