[CSHARP-1916] Ability to have 2 different serialization configuration within the same process Created: 12/Feb/17 Updated: 31/Mar/22 |
|
| Status: | Backlog |
| Project: | C# Driver |
| Component/s: | Configuration, Serialization |
| Affects Version/s: | 2.4 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Lenny Granovsky | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I have a POCO object (ClassA) that is configured with certain Bson attributes for class and properties. Of cause when I save an instance of it to the DB, driver honers all attributes. I have another object that is declared as: [BsonElement] } This is similar to providing multiple Property names resolvers to JSON.NET... Is this possible to do? If so, how would I do this? Do you plan to add this capability if not yet available? |
| Comments |
| Comment by Lenny Granovsky [ 20/Apr/17 ] |
|
Since I didn't get response for last comment, I would like to rephrase it: is it possible to provide an option to ignore all Bson attributes by passing special config parameter into serialization context? |
| Comment by Lenny Granovsky [ 02/Mar/17 ] |
|
Maybe it would be possible from simpler option to "ignore serialization Bson attributes"? This would provide lots of help already. |
| Comment by Robert Stam [ 02/Mar/17 ] |
|
We have talked about the possibility of supporting multiple simultaneous serialization configurations, but it is difficult to do, so for the foreseeable future it is unlikely that we will be able to do this. |
| Comment by Lenny Granovsky [ 12/Feb/17 ] |
|
I would like to add that this is essentially equivalent of an option to enforce ignoring all attributes for sub-classes under "dynamic" typed property when saving to DB. |