Night Walker
Night Walker

Reputation: 21280

Select into List<int> from grouped objects

How can I select into a list of integers from the following code select grouped by McID?

machinesVisited.GroupBy(x=> x.McID).

Thanks for help.

Upvotes: 0

Views: 51

Answers (1)

I4V
I4V

Reputation: 35363

var list = machinesVisited.GroupBy(x=> x.McID).Select(g=>g.Key).ToList();

Upvotes: 3

Related Questions