dimanche 28 septembre 2014

Create List by Unique Key with Linq


Vote count:

0




Given a list of Source, Target both of which are ints:



1, 2
1, 5
2, 1
3, 4
3, 6


Is it possible to merge them with Linq so that the following is produced List<Tuple<int,List<int>>:



1, [2,5]
2, [1]
3, [4,6]


Given a larger list of a couple of thousand items, would using Linq be the fastest way to perform the above merge?



asked 41 secs ago

g18c

193






Create List by Unique Key with Linq

Aucun commentaire:

Enregistrer un commentaire