Wednesday, May 21, 2014

Quintessential Select Lambda!

In C#, pluck out all of the unique ids from a list of some type to another collection like so:

List<Foo> foos = Whatever();
int[] fooIds = foos.Select(x => x.FooId).ToArray();

No comments:

Post a Comment