Пример #1
0
 private static void PopulateCache(string raceId)
 {
     using (var db = new RaceAnalysisDbContext())
     {
         var raceService = new RaceService(db);
         var athletes    = raceService.GetAthletes(
             new BasicRaceCriteria
         {
             SelectedRaceIds     = new string[] { raceId },
             SelectedAgeGroupIds = AgeGroup.Expand(new int[] { 0 }),
             SelectedGenderIds   = Gender.Expand(new int[] { 0 })
         }
             );
     }
 }
Пример #2
0
        private static int GetTriathletes(string raceId, int[] ageGroupIds, int[] genderIds)
        {
            using (var db = new RaceAnalysisDbContext())
            {
                var raceService = new RaceService(db);
                var athletes    = raceService.GetAthletes(
                    new BasicRaceCriteria
                {
                    SelectedRaceIds     = new string[] { raceId },
                    SelectedAgeGroupIds = ageGroupIds,
                    SelectedGenderIds   = genderIds
                },
                    false   /*do not use cache*/

                    );
                return(athletes.Count());
            }
        }