Details
-
Task
-
Resolution: Done
-
Critical - P2
-
None
-
1.8.1
-
None
-
Windows client, Windows server
-
Major Change
Description
We are in the process of upgrading our code to use driver 1.8.1.
Code now compiles fine after removing the warning for obsoletes function calls. However our acceptance tests are raising exceptions of the following kind:
"MongoDB.Bson.Serialization.Serializers.BsonDocumentSerializer can only be used with type MongoDB.Bson.BsonDocument, not with type xxx.Resource."
Resource is a custom class of ours extending BsonDocument and implementing a custom interface.
For example the exception is thrown by the second line in the following snippet:
MongoCollection<Resource> Entities = mongo.DB.GetCollection<Resource>("mycollection");
Resource found = Entities.FindOneByIdAs<Resource>("abc");
This used to work fine in 1.7.1 and all previous versions.
Any tip?