exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 115 discussion

Actual exam question from Microsoft's 70-483
Question #: 115
Topic #: 2
[All 70-483 Questions]

DRAG DROP -
An application serializes and deserializes XML from streams. The XML streams are in the following format:

The application reads the XML streams by using a DataContractSerializer object that is declared by the following code segment:

You need to ensure that the application preserves the element ordering as provided in the XML stream.
You have the following code:

Which attributes should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer, drag the appropriate attributes to the correct targets in the answer area. Each attribute 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:
Target 1: The DataContractAttribute.Namespace Property gets or sets the namespace for the data contract for the type. Use this property to specify a particular namespace if your type must return data that complies with a specific data contract.
Target2, target3: We put Order=10 on FirstName to ensure that LastName is ordered first.
Note:
The basic rules for data ordering include:
✑ If a data contract type is a part of an inheritance hierarchy, data members of its base types are always first in the order.
✑ Next in order are the current types data members that do not have the Order property of the DataMemberAttribute attribute set, in alphabetical order.
✑ Next are any data members that have the Order property of the DataMemberAttribute attribute set. These are ordered by the value of the Order property first and then alphabetically if there is more than one member of a certain Order value. Order values may be skipped.

Reference: Data Member Order -
https://msdn.microsoft.com/en-us/library/ms729813(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.namespace(v=vs.110).aspx

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
kartal
Highly Voted 5 years, 11 months ago
1,2,3 datacontract(namespace), memmer=10, member
upvoted 11 times
...
nichlas
Most Recent 4 years, 5 months ago
Why can't [datacontract]be used (without namespace)? And why isn't it 1,3,2? According to the link below datamembers without order will be first, and with orders will appear after. https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/data-member-order
upvoted 2 times
nichlas
4 years, 5 months ago
Nevermind.. I should just read the question again.
upvoted 1 times
...
...
ajpatonline
4 years, 5 months ago
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/data-member-order
upvoted 1 times
...
mmarinov
5 years, 2 months ago
I think that the answer is 1,3,2
upvoted 3 times
mmarinov
5 years, 2 months ago
1,2,3, my bad.
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 ...