We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey, I am working on a project that uses this library. The library actually is great. Are there any plans to implement a serializer for Offset?
I checked using this code, it currently produces an empty object:
using System; using MongoDB.Bson; using MongoDb.Bson.NodaTime; using NodaTime; namespace TestOffset { class Data { public Offset Offset { get; set; } } class Program { static void Main(string[] args) { NodaTimeSerializers.Register(); var data = new Data { Offset = Offset.FromHours(4), }; Console.WriteLine(data.ToBsonDocument()); // { "Offset" : { } } } } }
The text was updated successfully, but these errors were encountered:
Hi! I'm glad it is working well for you.
Adding support for Offset should be fairly straightforward, as there is a serialization pattern for it in NodaTime.Text. (https://nodatime.org/3.0.x/api/NodaTime.Text.OffsetPattern.html)
We already have a base class that wraps things nicely, and using that might make it Just Work(TM). See DurationSerializer.cs for an example.
I'd happily accept a PR if you want to take a stab at it. :)
Sorry, something went wrong.
Thanks for the PR and the build fix! This is pushed to nuget as 2.1.0.
No branches or pull requests
Hey, I am working on a project that uses this library. The library actually is great. Are there any plans to implement a serializer for Offset?
I checked using this code, it currently produces an empty object:
The text was updated successfully, but these errors were encountered: