Произошла ошибка, когда десериализация свойства усечения класса привела к потере данных.
//This means that there was an exception casting from a more detailed object to a less
//Solution A:
JObject.Parse(
JsonConvert.SerializeObject(
BsonTypeMapper.MapToDotNetValue(bson)
)
);
//Solution B: mapping and setting allowTruncation: true
//This is done at the startup level
BsonSerializer.RegisterSerializer(
typeof(float),
new DoubleSerializer(
BsonType.Double,
new RepresentationConverter(
allowOverflow: true,
allowTruncation: true
)
)
);
Upvote answer :-)