-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.4.1
-
Component/s: None
-
None
Thank you for the new version.
Release notes:
> There are no breaking changes in this release.
There is a breaking change. It is mentioned in "Change Log v1.4.1-Bson.txt":
BsonDocument.cs
changed SetDocumentId to assume Id is already of type BsonValue
Thus, when I call it with `int`, as I used to, then I get the exception:
Unable to cast object of type 'System.Int32' to type 'MongoDB.Bson.BsonValue'.
The method `SetDocumentId(object id)` is confusing now. It accepts `object id` but internally does:
var idBsonValue = (BsonValue)id;
This is unsafe and even not documented in code comments. Either this method should accept `BsonValue` or it should handle any suitable objects, as it did before.