exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 24 discussion

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

You are developing a library management application that uses the ADO.NET Entity Framework against a SQL Server database.
The application has a method that returns check outs filtered by date.
The Book class is shown below.

You must filter the data on the SQL server before it is returned to the application server.
You need to return books checked out more recently than the entered date.
Which code segment should you use?
A)

B)

C)

D)

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
IQueryable should be used when we want to filter the data.

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
gbmoutella
Highly Voted 5 years, 5 months ago
D is the correct one. If you use ToList in a queryable object you will bring all the table before filtering
upvoted 11 times
...
supersunny
Highly Voted 5 years, 5 months ago
I support D as the correct answer cos IQueryable is needed when filtering.
upvoted 10 times
...
sti88
Most Recent 4 years, 8 months ago
The answer is correct; D
upvoted 3 times
...
MalaSvinjica
5 years, 2 months ago
Answer is correct
upvoted 6 times
...
Moca3
5 years, 4 months ago
It's D
upvoted 7 times
...
[Removed]
5 years, 6 months ago
Answer is not correct. The answer should be B. Because, with ToList will be the query executed and set asQueryable. Then you can apply where clause.
upvoted 1 times
elathir
4 years, 10 months ago
The answer B is one the the most common and one of the worst mistakes that can by done with both Entity framework and Ado Net. In case of big DBs it will in most cases kill the whole application, as loading dozens of GB into memory at once is never a smart idea.
upvoted 4 times
...
mstu
5 years, 6 months ago
The data must be filtered on the SQL server before it is returned to the app. server. D is correct, otherwise all books would be pulled from the DB and filtered in memory (application) afterwards.
upvoted 33 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 ...