exam questions

Exam AZ-200 All Questions

View all questions & answers for the AZ-200 exam

Exam AZ-200 topic 3 question 14 discussion

Actual exam question from Microsoft's AZ-200
Question #: 14
Topic #: 3
[All AZ-200 Questions]

DRAG DROP -
You are developing a rating service for books that runs on Azure Service Fabric. One of the services uses reliable collections that update the ratings of a book.
Testers report that the ratings are not updates when the code is run.
You need to implement the code to ensure that ratings are updates in the collection.
You have the following class:

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.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer: Explanation
Box 1: Book updatedBook = new Book(currentBook);
Create new user object with the same state as the current user object.
NOTE: This must be a deep copy; not a shallow copy. Specifically, only immutable state can be shared by currentUser & updatedUser object graphs.
Box 2: updatedBook.Rating = updatedBook.Rating+1;
Await m_dic.SetValue(tc, name, updatedBook);
In the new object, modify any properties you desire.
Update the key's value to the updatedBook info
References:
https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-work-with-reliable-collections

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
Currently there are no comments in this discussion, be the first to comment!
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 ...