exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 28 discussion

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

DRAG DROP -
You are supporting a WCF data contract that can be expanded to add new data members.
Clients using the old version of the data contract must be supported.
You need to define the data contract so that the data serializer can put unknown data members into a property bag.
You have the following code:

Which code segments should you include in Target 1 and Target 2 to complete the data contract? (To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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: IExtensibleDataObject -
Implement the IExtensibleDataObject interface to store the extra data for future versions.

Target 2: ExtensionDataObject -
To implement the IExtensibleDataObject interface, you must implement the ExtensionData property. The property holds data from future versions of the class for backward compatibility.
Example code:
[DataContract]
class Person : IExtensibleDataObject
{
private ExtensionDataObject extensionDataObject_value;
etc.
References:
https://msdn.microsoft.com/en-us/library/system.runtime.serialization.extensiondataobject(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
DIPE
Highly Voted 5 years, 7 months ago
Target 2 should be ExtensionDataObject i think.
upvoted 24 times
fbelhocine
4 years, 5 months ago
agree https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.extensiondataobject?view=netframework-4.5
upvoted 1 times
...
...
Aerologic
Highly Voted 5 years, 6 months ago
Target 2 should definitely be ExtensionDataObject since that's the property type IExtensibleDataObject has. https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iextensibledataobject?view=netframework-4.8
upvoted 6 times
...
gokhan
Most Recent 4 years, 6 months ago
Yes, target 2 should be ExtensionDataObject. An example; public partial class XXXXX : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
upvoted 2 times
...
Lt_munchies
4 years, 8 months ago
Target 2 should be ExtensionDataObject
upvoted 2 times
...
tanujgyan
5 years ago
In the explanation also they have mentioned it as ExtensionDataObject
upvoted 3 times
...
mchen
5 years, 2 months ago
Target 2 is ExtensionDataObject
upvoted 3 times
...
supersunny
5 years, 4 months ago
I support you guys on this too. The target 2 should be ExtensionDataObject
upvoted 3 times
...
[Removed]
5 years, 5 months ago
Target 2: ExtensionDataObject. See link: https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/forward-compatible-data-contracts
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 ...