private void ReloadPersonTurns() { personTurns = turnsRepository.GetTurnsForActivity(activityId) .GroupBy(t => t.PersonId) .Select(g => new PersonTurns { PersonName = turnsRepository.GetPerson(g.Key).Name, TurnsCount = g.Count(), LatestTurnTimestamp = g.Any() ? g.Max(t => t.Timestamp) : (DateTime?)null }) .OrderByDescending(t => t.TurnsCount) .ThenByDescending(t => t.LatestTurnTimestamp) .ToArray(); }
private void ReloadTurns() { turns = turnsRepository.GetTurnsForActivity(activityId) .OrderByDescending(t => t.Timestamp) .ToArray(); }