-
Type: New Feature
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.4
-
Component/s: Configuration, Serialization
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:
public class EventData
{
public Guid Id
[BsonElement]
public dynamic Details
}
I assign ClassA instance to the Details property of the EventData. When I save the EventData to the DB, driver attaches "_t" element as well follows all Bson attributes that ClassA declares, including property name aliases, etc.
I would like that when ClassA is being saved on its own, driver follows all instructions the Bson attributes provide, but when ClassA is being saved as part of EventData, driver should ignore the Bson attributes declared in ClassA.
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?