简体   繁体   中英

How to concat to IEnumerable IGrouping?

I have two IEnumerable IGrouping in my C# program:

IEnumerable<IGrouping<string, FileItem>> number1
IEnumerable<IGrouping<string, FileItem>> number2

Is it somehow possible to concat these two IEnumerable into one?

You could make use of the Concat method:

var concatenated = number1.Concat(number2);

For more info about this method, please have a look here .

Concat should work:

IEnumerable<IGrouping<string, FileItem>> concatenated = number1.Concat(number2);

https://msdn.microsoft.com/en-us/library/bb302894(v=vs.110).aspx

您是否正在寻找类似的东西?

var groupedNumbers = number1.Concat(number2);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM