Another way (as an alternative to solution #1) is to use
GroupBy
+
Select
var distinctValues = listofvalues
.GroupBy(x => new {Day = x.Day, Id = x.Id, Time = x.Time})
.Select(grp => grp.First())
.ToList();
Shorter version of above:
var distinctValues = listofvalues
.GroupBy(x => new {Day = x.Day, Id = x.Id, Time = x.Time}, (key, x) => x.FirstOrDefault())
.ToList();
or use
ToLookup()[
^]
var distincts = listofvalues
.ToLookup(c => new {Day = x.Day, Id = x.Id, Time = x.Time})
.Select(g => g.First())
.ToList();