/// <summary> /// Get all matches list into MatchList property ordered by MatchDate desc /// </summary> public void ReadAllMatches() { try { if (AllMatchList == null || AllMatchList.Count == 0) { readJsonMatches(); // Just in case! } MatchList = AllMatchList .OrderByDescending(m => m.MatchDate) .ToList(); } catch (Exception ex) { throw ex; } }
/// <summary> /// Get matched list within period into MatchList property ordered by MatchDate desc /// </summary> public void MatchesByPeriod(DateTime startDate, DateTime endDate) { try { if (AllMatchList == null || AllMatchList.Count == 0) { readJsonMatches(); // Just in case! } MatchList = AllMatchList .Where(m => m.MatchDate >= startDate && m.MatchDate < endDate.AddDays(1)) .OrderByDescending(m => m.MatchDate) .ToList(); } catch (Exception ex) { throw ex; } }