I would like to SetIgnoreIfDefault(true) for ALL properties of a class. (this can save TONS of default data in the storage)
I can call SetIgnoreIfDefault explicitly for every property:
BsonClassMap.RegisterClassMap<MyClass>(cm =>
{
cm.AutoMap();
cm.MapProperty(x => x.A).SetIgnoreIfDefault(true);
cm.MapProperty(x => x.B).SetIgnoreIfDefault(true);
cm.MapProperty(x => x.C).SetIgnoreIfDefault(true);
cm.MapProperty(x => x.D).SetIgnoreIfDefault(true);
cm.MapProperty(x => x.E).SetIgnoreIfDefault(true);
...
cm.SetIgnoreExtraElements(true);
});
However I have many classes and many properties , and If I modify the classes I need to remember to change the Registration.
Is there is a way to set it for ALL properties of a class in one call?
Is there is a way to set it for ALL properties Globally?
Thanks