I'm using OrmLite and one of my entities has property of type Dictionary of DateTime and int and it fails to deserialize that property. I found out that this is Jsv serializer problem. I have failing test:
[Test]
public void Can_serialize_and_deserialize_Dictionary_with_DateTime_key()
{
JsConfig.DateHandler = JsonDateHandler.TimestampOffset;
var expected = new Dictionary<DateTime, int> {{DateTime.Now, 5}};
var serializedString = TypeSerializer.SerializeToString(expected);
var actual = TypeSerializer.DeserializeFromString<Dictionary<DateTime, int>>(serializedString);
Assert.AreEqual(actual.Keys.First().Year, expected.Keys.First().Year);
}
Can anyone suggest how this could be fixed? This seems like Jsv format problem in general and not implementation bug. (but I might be wrong)