Closed shersh closed 3 years ago
But there is no solution I guess
@SebastianStehle why? If you cast ULong to long and after cast it to ULong - you will get rigth number. Problem is in deserialization from bson document to model.
The provider uses JSON.NET for serialization and then converts it to BSON: https://github.com/OrleansContrib/Orleans.Providers.MongoDB/blob/master/Orleans.Providers.MongoDB/StorageProviders/JsonBsonConverter.cs
If you have a solution you can provide a PR for it.
I recommend to provide a custom serializer for this case.
I know, MongoDb does not support UInt64 and UInt32 types. But this provider allows save state with ulong field as long and can't read this if field will be overflowed for long.
For example
It will cast to long during saving to db. But will be crashed when activating grain again.