I am getting
MongoDB.Bson.BsonSerializationException : GuidSerializer cannot serialize a Guid when GuidRepresentation is Unspecified.
I added the required attribute to the field:
[BsonGuidRepresentation(GuidRepresentation.Standard)]
After doing this, read and write operations work. The delete operation keeps failing with the same error above.
_collection.DeleteOne(filter);
I tried registering GuidSerializer from code but it gives an error that GuidSerializer is already registered (I tried the try… version too )
I am using C# driver 3.1 , .NET 9.0
Thanks