Reputation: 631
I need to persist LocalDate
(from NodaTime) in RavenDB. The object it's represented by is IDictionary<string, object>
. Saving works fine (with a little help from https://github.com/ryanheath/RavenDB-NodaTime), but loading returns string
. Is there a way to get LocalDate
(boxed into object
, obviously) on loading?
Upvotes: 1
Views: 36
Reputation: 666
You would need to customize the JsonSerializer and add a new converter for this.
You can take a look on following examples:
https://github.com/ravendb/ravendb/blob/v4.2/test/SlowTests/Issues/RavenDB_12194.cs#L22
Upvotes: 2