I have two sets of datarows. They are each IEnumerable. I want to append/concatenate these two lists into one list. I\'m sure this is doable. I don\'t want to do a for loop
The Join method is like a SQL join, where the list are cross referenced based upon a condition, it isn't a string concatenation or Adding to a list. The Union method does do what you want, as does the Concat method, but both are LAZY evaluations, and have the requirement the parameters be non-null. They return either a ConcatIterator or a UnionIterator, and if called repeatedly this could cause problems. Eager evaluation results in different behavior, if that is what you want, then an extension method like the below could be used.
public static IEnumerable myEagerConcat(this IEnumerable first,
IEnumerable second)
{
return (first ?? Enumerable.Empty()).Concat(
(second ?? Enumerable.Empty())).ToList();
}