Skip to content
New issue

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

Add custom read write functions #44

Merged
merged 2 commits into from
Oct 9, 2015

Conversation

neoeinstein
Copy link
Member

Sometimes there is a need to serialize or deserialize values for types that were not created within the same assembly. Extension methods don't work to add ToJson or FromJson methods to these types. In this PR, I use System.DayOfWeek as the exemplar, but I plan to use it for serializing types from the NodaTime library. The key change here is to expose the Json -> JsonResult<'a> and 'a -> Json shaped holes in the read/write functions.

Let me know what you think.

@kolektiv kolektiv merged commit c21f50e into xyncro:master Oct 9, 2015
@kolektiv
Copy link
Member

kolektiv commented Oct 9, 2015

Merged this in via a local pull, etc. Very cool! It'll be in 5.1.0 (#45) very shortly. There's some (currently non-breaking) changes to lens functions in there as well if you're using them - deprecations given though. Thanks for this, it's a very useful and usable change - awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants