-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: Public Preview 1
-
Dotnet Drivers
I want to use EF Core to save an object and suppress saving of all the fields that has default values. This works just fine (as in properties with null/default values don't get saved to MongoDB) with configuring BsonClassMap (using explicit configuration in code rather than attributes, but attributes also works) and saving the objects with coll.InsertOne.
However when saving the same object with EF Core
var db = StarGateDbContext.Create(client.GetDatabase("Sinelec")); // Create db.Add(transit); db.SaveChanges();
all properties are saved, default values or not. Adding the [DataMember(EmitDefaultValue=false)] makes no difference.
Not sure if this is just something that's not yet implemented or if it is a de-facto bug.