L
Lars-Erik
Hi!
I've been fiddling with composing objects with partial data in two
data-stores.
I'd like to join them 1-1 and put the inner objects on a corresponding
property on the outer one.
What I can't figure out is how to do this without creating new objects of
the outer type, assigning all properties of the outer anew, and the innter to
the correct property.
IE.
(outer, inner) => new OuterType { Prop1 = outer.Prop1, ..., InnerProp =
inner }
This tends to be a bit verbose. (and does a whole new lot of instancing)
What I'd like is this, which compiles, but don't work:
(outer, inner) => { outer = outer; outer.InnerProp = inner; }
Which in my head would keep the outer object as the main object in the
resulting enumerable with the inner object neatly assigned to its InnerProp
property.
Is it possible?
I've been fiddling with composing objects with partial data in two
data-stores.
I'd like to join them 1-1 and put the inner objects on a corresponding
property on the outer one.
What I can't figure out is how to do this without creating new objects of
the outer type, assigning all properties of the outer anew, and the innter to
the correct property.
IE.
(outer, inner) => new OuterType { Prop1 = outer.Prop1, ..., InnerProp =
inner }
This tends to be a bit verbose. (and does a whole new lot of instancing)
What I'd like is this, which compiles, but don't work:
(outer, inner) => { outer = outer; outer.InnerProp = inner; }
Which in my head would keep the outer object as the main object in the
resulting enumerable with the inner object neatly assigned to its InnerProp
property.
Is it possible?