Hi Friends,
how to remove duplicate value in below code?
below code will return 2 list rows
ex:
items:
2020 lineid1 workshop1
2020 lineid2 workshop2
i will loading above data in 3 different dropdowns.
so i need to remove duplicate value in year drop down.. please help
var items = db.ReferenceCrisisSplEvents.Where(x => x.Active == true && x.LineID == Data).OrderByDescending(x => x.StartDate.Year)
.Select(x => new
{
YEAR = x.StartDate.Year,
LINEID = x.LineID,
WORKSHOP = x.WorkshopTypeListID,
}).ToList();
foreach (var typeItem in items.Distinct()) {
}
but i can't remove duplicate year..