public List<ClassStatusDto> GetStatusForClasses(int showDetailsId) { var statuses = new ClassStatus().GetClassStatus(showDetailsId); var list = new List<ClassStatusDto>(); foreach (var obj in statuses) { list.Add(new ClassStatusDto { RingId = obj.RingId, ClassId = obj.ClassId, InClass = obj.InClass, QueueCount = obj.QueueCount, RanCount = obj.RanCount, State = obj.State, LastUpdated = obj.LastUpdated }); } return list; }
public List<ClassStatusDto> GetLatestStatusForRings(int showDetailsId) { var statuses = new ClassStatus().GetClassStatus(showDetailsId); var list = new List<ClassStatusDto>(); var tmp = from rs in statuses group rs by rs.RingId into rg orderby rg.Key select rg.Last(); foreach (var obj in tmp) { list.Add(new ClassStatusDto { RingId = obj.RingId, ClassId = obj.ClassId, InClass = obj.InClass, QueueCount = obj.QueueCount, RanCount = obj.RanCount, State = obj.State, LastUpdated = obj.LastUpdated }); } return list; }