-
Type: Bug
-
Resolution: Duplicate
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Dotnet Drivers
Summary
After upgrade from C# Driver v2.30.0 to v3.0.0 I get a NotSupportedException when trying to query a collection for a derived type using collection.OfType<DervivedType>().Find(...).
MongoDB-Server version: 6.0
MongoDB C# Driver version: 3.0.0
.NET version: 8.0
How to Reproduce
Code that reproduces the issue: https://github.com/mindleaving/mongodb-csharp-v3-polymorphism-issue __
Additional Background
I use BsonKnownTypeAttribute to declare derived types on parent class. Using BsonDiscrimnatorAttribute doesn't solve the issue. No class maps are set up.
- duplicates
-
CSHARP-5356 Support `OfType` and `is` with scalar discriminators when using class mapped serializers
- In Code Review