ImmutableObjectGraph icon indicating copy to clipboard operation
ImmutableObjectGraph copied to clipboard

Add CopyInto method to the builders

Open bradphelan opened this issue 9 years ago • 1 comments

This adds the ability to reset a builder with an immutable object by copying all the fields into the builder. I think it handles recursive builders correctly.

Writing Roslyn syntax trees is an excercise in pain though. I'm not sure that T4 templates are easier to deal with. The expression trees are so verbose to be unintelligable.

bradphelan avatar Aug 17 '16 14:08 bradphelan

I haven't finished reviewing, but it looks promising. I would want to rename CopyInto to CopyFrom to more clearly indicate that the argument is providing the template instead of receiving it. Consider the .NET CopyTo method, which copies from the receiver to the argument.

AArnott avatar Aug 22 '16 02:08 AArnott