Remove duplicates in the list using linq

var distinctItems = items.GroupBy(x => x.Id).Select(y => y.First());

Leave a Comment