You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Don't create new ContractResolver on every serialization/deserialization (#609)
* Don't create JsonDateTimeContractResolver on every serialization/deserialization.
* Fix some tests for unix systems.
Co-authored-by: Josh Plooster <[email protected]>
privateJsonDateTimeContractResolver_jsonDateTimeContractResolver=newJsonDateTimeContractResolver();// This will make us use ticks instead of json ticks for DateTime.
34
35
35
36
/// <summary>
36
37
/// Initializes a new instance of the <see cref="InMemoryBlobCache"/> class.
settings.ContractResolver=newJsonDateTimeContractResolver(settings.ContractResolver,ForcedDateTimeKind);// This will make us use ticks instead of json ticks for DateTime.
settings.ContractResolver=newJsonDateTimeContractResolver(settings.ContractResolver,ForcedDateTimeKind);// This will make us use ticks instead of json ticks for DateTime.
Copy file name to clipboardexpand all lines: src/Akavache.Sqlite3/SqlLiteCache/SqlRawPersistentBlobCache.cs
+15-3
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ public class SqlRawPersistentBlobCache : IObjectBlobCache, IEnableLogger, IObjec
36
36
privateIDisposable_queueThread;
37
37
privateDateTimeKind?_dateTimeKind;
38
38
privatebool_disposed;
39
+
privateJsonDateTimeContractResolver_jsonDateTimeContractResolver=newJsonDateTimeContractResolver();// This will make us use ticks instead of json ticks for DateTime.
39
40
40
41
/// <summary>
41
42
/// Initializes a new instance of the <see cref="SqlRawPersistentBlobCache"/> class.
settings.ContractResolver=newJsonDateTimeContractResolver(settings.ContractResolver,ForcedDateTimeKind);// This will make us use ticks instead of json ticks for DateTime.
settings.ContractResolver=newJsonDateTimeContractResolver(settings.ContractResolver,ForcedDateTimeKind);// This will make us use ticks instead of json ticks for DateTime.
privatestaticDateTimeLocalTestNow{get;}=TimeZoneInfo.ConvertTimeFromUtc(TestNow.ToUniversalTime(),TimeZoneInfo.CreateCustomTimeZone("testTimeZone",TimeSpan.FromHours(6),"Test Time Zone","Test Time Zone"));
60
55
61
56
/// <summary>
62
57
/// Gets the date time off set when the tests are done to keep them consistent.
0 commit comments