Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

In LINQ, how to concatenate multiple list of integers into one list (in LINQ, not in standard declerative mode)

$
0
0

Having

List<IElement> elem;

where the interface IElement forces the objects to implement

int[] GlobalNumberForEquation { get; }

I want to get a list of Distinct integers returned by GlobalNumberForEquation from all objects in elem. Sure, each object of elem returns its own list of integers, through GlobalNumberForEquation, so, that appears to be simple to acheive through LINQ, but CONCAT (or preferably UNION) seems to want only with TWO arguements, so I fail to see how I can "start" with a

var result = elem.ForEach( x =>  ....   )

Any idea?


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>