[CSHARP-696] Allow serialization to take into the XmlIgnore attribute Created: 06/Mar/13  Updated: 20/Mar/14  Resolved: 27/Mar/13

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.8
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Martin Thwaites Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CSHARP-623 DOCS: BsonClassMap.RegisterClassMap t... Closed
related to CSHARP-279 Implement an IBsonSerializer for XmlD... Closed
Backwards Compatibility: Major Change

 Description   

Currently, the default serialization mechanism ignores the [XmlIgnore] flag on attributes.

Taking this attribute into account should not be default behavior as there may be people using this for other things.

I believe there may be a workaround to this using conventions and also something is being worked on for 1.8, so any information on the workaround may be helpful to people looking into this.

The use case is that we have a large number of classes that we currently do serialize into Binary and use the XmlIgnore attribute to remove some of the properties. We want now add some additional serialization of the objects into Mongo.



 Comments   
Comment by Craig Wilson [ 13/Mar/13 ]

Should be relatively trivial to support with the new convention system. How deep we want to go with the xml attributes is a potential issue. There are a lot of them and they don't necessarily reflect directly into our bson serialization the way that XmlIgnore does.

I'm not convinced this should be part of the driver, but rather it should be more of a contrib project.

Generated at Wed Feb 07 21:37:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.