c# list remove item based on property duplicate

C#
fooArray.GroupBy(x => x.Id).Select(x => x.First());
Source

Also in C#: