我想在 c# 中使用以下代码选择唯一的 EventYear,它给出了重复的值。我的表(EventMasters)
结构是(EventYear (string), EventCode, EventDescription)
我想选择独特的或不同的EventYear
public ActionResult EventYearsMenu()
{
var eventyears = storeDB.EventMasters.Distinct().ToList().OrderByDescending(c => c.EventYear== c.EventYear.Distinct());
return PartialView(eventyears);
}