Of course the example above might easily be shortened as var relocated = person.WithPrimaryAddress(newAddress); but this is more useful when updating many properties at the same time.
The text was updated successfully, but these errors were encountered:
Builder would allow for easier instantiation in tree structures or multiple mutations (close to
ImmutalbeList<T>.Builder
), eg.for:
generator would provide, in addition to primary ctor, mutators and collection mutators, a builder:
Usage
Of course the example above might easily be shortened as
var relocated = person.WithPrimaryAddress(newAddress);
but this is more useful when updating many properties at the same time.The text was updated successfully, but these errors were encountered: