mbraceproject / FsPickler

A fast multi-format message serializer for .NET
http://mbraceproject.github.io/FsPickler/
MIT License
323 stars 54 forks source link

Using a custom pickler to replace one or more values in an immutable record #114

Open dallinbeutler opened 5 years ago

dallinbeutler commented 5 years ago

To preface, I'm making a UI that can take any record (or class if I can) and create a form of dials and input boxes for each property that can be tweaked. making those tweaks results in a new copy of the record with the changes from the UI. 'state->'state

My guess is that I implement a [<custompickler>] and override the clone function for every type I want editable. The problem with this method is that the clone method doesn't have access to the tag to make a display label for what is being edited.

Is there an easier way?

Sorry if this is a dumb question, still trying to wrap my head around the library/concept