public List <AreaElection> FilterTag(string tagName) { var getFilterPartyName = AreaElectionColloection.Find(it => it.PartyName == "เพื่อไทย").ToList(); var getTag = getFilterPartyName.Where(it => it.Tag == tagName).ToList(); return(getTag); }
public List <AreaElection> GetMaxAreaElection() { var getDataArea = AreaElectionColloection.Find(it => true).ToList(); var dataElection = getDataArea.GroupBy(it => it.NameArea).ToList(); var listMaxArea = new List <AreaElection>(); foreach (var item in dataElection) { var itemMax = item.FirstOrDefault(it => it.Score == item.Max(i => i.Score)); listMaxArea.Add(itemMax); } return(listMaxArea); }
public List <AreaElection> GetAllAreaElection() { var getDataArea = AreaElectionColloection.Find(it => true).ToList(); return(getDataArea); }