Closed pedefe closed 2 years ago
Solution seems to be with Mapper:
/*
* */
public Func<BigInteger, BsonValue> serialize_BigInteger = (bi) => {
BsonValue bv;
String s = bi.ToString();
bv = new BsonValue(bi.ToString());
return bv;
};
/*
* */
public Func<BsonValue, BigInteger> deserialize_BigInteger = (bv) => {
BigInteger bi;
String s = bv.AsString;
bi = BigInteger.Parse( s);
return bi;
};
ldb = new LiteDatabase(...);
ldb.Mapper.RegisterType<BigInteger>(
serialize: (bi) => serialize_BigInteger( bi),
deserialize: (bsonv) => deserialize_BigInteger(bsonv)
);
Hello,
I manage class fields based on System.Numerics.BigInteger values (mainly for year...). With previous version, it was working. Now (release 5.0.12), BigInteger are no more understand and all values are 0. How to allow the LiteDb to work correctly with such a type ? Best regards.