I had a project in .Net Core 2.1 that was working fine. One of my classes has a prop like:
public bool? Terms { get; set; }
Was working fine. After I upgraded to .Net Core 3.1, the old items of the collection started to throw errors when biding to this prop.
The wierd part is that the new regs created from 3.1, dont throw any error on the bind of this prop.
The 2.1 reg and the the 3.1 has the same value on MongoDB:
"Terms" : null
For the old ones, the error thrown is:
Unable to cast object of type 'MongoDB.Bson.BsonBoolean' to type 'MongoDB.Bson.BsonArray'.
- duplicates
-
CSHARP-3817 Bool? on .Net Core 2.1 it is not being bound on .Net Core 3.1 - Unable to cast object of type 'MongoDB.Bson.BsonBoolean' to type 'MongoDB.Bson.BsonArray'.
- Closed