exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 6 question 5 discussion

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

DRAG DROP -
You need to add code to line SU12 to implement the customer identification requirement.
How should you complete the code? To answer, drag the appropriate code segments to the correct locations. 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:

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
bobtables
Highly Voted 5 years, 5 months ago
I think it's... Scoped<IEventDB, EventDB>()
upvoted 35 times
tiger25
5 years, 3 months ago
Agreed.
upvoted 7 times
...
...
viniventura
Highly Voted 5 years ago
The extension method AddIdentity() exists, however it does not have anything to do in the context. The IEventDB is a service injected inside the EventsController to query the database as we can see in GetEvents() method, so for me the correct answer is: Scoped<IEventDB, EventDB>() No doubt about it.
upvoted 9 times
...
Dev666
Most Recent 4 years, 8 months ago
how do we know its Scoped vs Singleton
upvoted 2 times
Jobair
4 years, 7 months ago
Because, CurrentCustomer is assigned to IEventDb in the middleware for the request scope. Singleton will share the same value throught the requests, and we don't want that.
upvoted 4 times
...
klassanov
4 years, 5 months ago
Scoped, because from the middleware we see that we need a new instance per each HTTP request (per each HttpContext)
upvoted 2 times
...
...
Natali
4 years, 11 months ago
AddIdentity is <TUser, TRole> , which are types inheriting from IdentityUser and IdentityRole, so this ext method its not designed for interface and its implementation mapping
upvoted 3 times
...
Karel_Gott
5 years, 1 month ago
I'll go for AddIdentity<IEventDB, EventDB>()
upvoted 3 times
...
supersunny
5 years, 2 months ago
I Agree to this
upvoted 2 times
...
seanlim
5 years, 5 months ago
AddIdentity does not exist. https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection?view=dotnet-plat-ext-3.0
upvoted 2 times
this_is_sparta
5 years, 2 months ago
It exists and is a Extension-Method: https://docs.microsoft.com/en-gb/dotnet/api/microsoft.extensions.dependencyinjection.identityservicecollectionextensions.addidentity?view=aspnetcore-3.1
upvoted 3 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