-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.8
-
Component/s: None
-
None
[Original description]
var value = BsonBoolean.Create("false");
value.RawValue == true
?!!!
[Edited description]
The BsonDocument object model has many Create methods that are not strictly required. We are going to do some cleaning up and remove them. There are explicit conversions that do exactly the same thing.
We are leaving the Create methods that take an object parameter, because in that case the user can't call a constructor, because the required BsonValue subclass isn't known at compile time.
We are also changing how the remaining Create methods handle C# null. They will now throw an ArgumentNullException if the value is C# null, with the exception of BsonValue.Create which will map C# null to BsonNull.Value.
We are also changing the Add methods to throw ArgumentNullException if callled with a C# null argument (they used to treat C# null as a no-op).
- related to
-
CSHARP-555 BsonDocument object model methods should throw ArgumentNullException instead of ignoring C# null
- Closed
-
CSHARP-557 Deprecate many Create methods from BsonDocument object model
- Closed
-
CSHARP-1287 DOCS- BsonValues no longer accept nulls in their ctors
- Closed