ryanheath / RavenDB-NodaTime

Noda Time support for RavenDB
Other
20 stars 14 forks source link

Noda types as metadata #30

Closed ddevader closed 2 months ago

ddevader commented 1 year ago

Raven DB doesn't currently easily support complex types as metadata.

Using the Noda types in metadata can currently be done using DynamicJsonValue and duplicating some of your internal logic.

A basic solution might be something like

  1. Offer an extension method for MetadataAsDictionary that uses your internal logic for the conversions. Something like .ToNodaType<T>
  2. Offer an extension method on DynamicJsonValue to add a Noda type. Something like .AddNodaType<T>

Or refactor internal conversion logic for public consumption in order to allow a user of your library to do something similar.

If there is a better/simpler way to do this, let me know.

Thanks in advance for your consideration.

ryanheath commented 1 year ago

Could you create a PR with the functionality you want. That might be better to understand your requirements and if they should be in this package.

// Ryan