i have three functions which are returning an IEnumerable collection.
now i want to combine all these into one List.
so, is there any method by which i can append items from IEnumerable to a list.
i mean without for each loop?
i have three functions which are returning an IEnumerable collection. now i want to
Share
Well, something will have to loop… but in LINQ you could easily use the
ConcatandToListextension methods:Note that this will create a new list rather than appending items to an existing list. If you want to add them to an existing list,
List<T>.AddRangeis probably what you’re after: