[CSHARP-623] DOCS: BsonClassMap.RegisterClassMap to support WCF DataContract/DataMember attributes Created: 04/Nov/12 Updated: 02/Feb/18 Resolved: 02/Feb/18 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Serialization |
| Affects Version/s: | 1.6.1 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Michael Bertelsen | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Description |
|
We have a lot of classes where the members is decorated with [DataMember]. It would be very nice if there was a AutoWcfMap in BsonClassMap that works as AutoMap but that looks at [DataMember] attributes instead. Example: Would iterate over all members (public/private fields/properties) and see look for the DataMember attribute and call SetElementName, SetOrder, SetDefaultValue etc. If the type have a member-type that is marked with the DataContract attribute and it is not currently a part of the registered types it should automatically map it too. |
| Comments |
| Comment by Robert Stam [ 02/Feb/18 ] |
|
There are no current plans to support DataContract based serialization. |
| Comment by Craig Wilson [ 05/Nov/12 ] |
|
You are completely free to write a convention to do this. See the docs here: http://www.mongodb.org/display/DOCS/CSharp+Driver+Serialization+Tutorial#CSharpDriverSerializationTutorial-Conventions for information on how to do that. |