I have a parent class X and two lists of child classes X1 and X2 (X1 and X2 derive from X). Is there an easy way to combine the lists of X1 and X2 into a list of Xs?
I could loop over the lists of X1 and X2 and add then to the list of X but this seems a bit cumbersome.
I have a parent class X and two lists of child classes X1 and
Share
LINQ can do this conveniently with
or with
but it’s looping nonetheless — just under the covers.