Thursday, December 8, 2011

Use Linq to obtain a unique list of properties from a list

Use the Distinct operator:
var idList = yourList.Select(x=> x.ID).Distinct();

No comments:

Post a Comment