Пример #1
0
 //public List<DriverInfoPilot>;
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (DriversStandings.GetDriverStandings() == null)
         {
             DriversStandings.MakeDriversStandings();
         }
         RepeaterDrivers.DataSource = DriversStandings.GetDriverStandings();
         RepeaterDrivers.DataBind();
     }
 }
Пример #2
0
        public async Task <DriversStandings> GetDriversStandings(int count, int?seasonId = null)
        {
            await SetDbEncoding();

            var model = new DriversStandings();

            if (seasonId == null)
            {
                seasonId = await context.Seasons
                           .Join(context.DriverStandingsPositions, s => s.Id, d => d.SeasonId, (s, d) => new { s, d })
                           .Where(g => g.d != null)
                           .Select(g => g.s)
                           .OrderByDescending(s => s.Year)
                           .Select(s => (int)s.Id)
                           .FirstAsync();
            }
            model.Positions = await GetDriverStandingsBySeasonId(count, seasonId.Value);

            return(model);
        }