Setting a member of a struct in a context doesn't change the struct

Create issue
Issue #45 resolved
Christian Oeing repo owner created an issue

When setting the value of a path in a context that points to a member of a struct, the context isn't changed. The reason is that the returned struct value is immutable and changing one of its members doesn't change the value in the context.

A solution would be to follow the path as long as the current value is not immutable. If it is, the complete value has to be fetched, adjusted at the rest of the path and be set. So the context has to realize when a struct node is passed and react accordingly.

Comments (4)

  1. Christian Oeing reporter

    In the current version 1.0.10 setting the value of a struct member raises an ArgumentException with "Invalid path" as a struct will be a leaf node in the data tree.

  2. Christian Oeing reporter

    When the value of a data node is changed it's checked if the parent value is a value type. If it is, the value of the parent node is set as well with the modified parent value. This way it also works recursively with structs inside structs.

  3. Log in to comment