-
Type: Improvement
-
Resolution: Done
-
Priority: Trivial - P5
-
Affects Version/s: 1.3.1
-
Component/s: None
-
Fully Compatible
BsonIgnoreExtraElementsAttribute
Could you consider adding the inherited option? I realize this might break older code if I understand correctly. In that case could you consider adding a new "BsonIgnoreExtraElementsAttributeInherited" (or something) attribute which is exactly the same but with the inherited = true option.
Maybe I'm on the wrong track tough, would love feedback on this.
My problem is that I am creating a repository on which all entities inherit from the Entity class; for my use-case it would be preferable to have all entities ignore extra elements when present and I don't like adding the BsonIgnoreExtraElementsAttribute to each and every entity.
I also tried inheriting from the BsonIgnoreExtraElementsAttribute e.g. "MyIgnore") and although it worked on the class I applied the "MyIgnore" attribute to, the inherited classes didn't ignore extra elements even though the MyIgnore had the inherited option set to true.
Again, I might be on the wrong track here; please correct me if I'm wrong.