[CSHARP-1478] BsonClassMap.Reset() is not consistent with default constructor Created: 15/Nov/15  Updated: 04/Jan/21  Resolved: 04/Jan/21

Status: Closed
Project: C# Driver
Component/s: Serialization
Affects Version/s: 2.1.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Antoine Bursaux Assignee: Boris Dogadov
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CSHARP-681 need a different way to accomplish Bs... Closed

 Description   

The default BsonClassMap constructor sets the IgnoreExtraElements property to false.

The BsonClassMap.Reset() method sets the IgnoreExtraElements property to true.

The behavior should be identical for both.



 Comments   
Comment by Boris Dogadov [ 04/Jan/21 ]

Hi bursauxa,
As you mentioned, BsonClassMap.IgnoreExtraElements defaults to true while the default convention pack sets IgnoreExtraElements to false. Consistency across default BsonClassMap state and default convection pack would be more natural behavior, but would result in a breaking behavior across all usages of BsonClassMap default state. Therefore we are going to close this PR.

Comment by Craig Wilson [ 15/Nov/15 ]

PR here: https://github.com/mongodb/mongo-csharp-driver/pull/225

Generated at Wed Feb 07 21:39:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.