Ejemplo n.º 1
0
        public static async Task <Dictionary <string, string> > BuildNumbersDictionary(RacesDbContext dataContext, int startId)
        {
            var categoryIds = await dataContext.Set <StartCategory>().Where(s => s.Start.Id == startId).Select(s => s.Category.Id).ToArrayAsync() ?? Array.Empty <int>();

            var riders = await dataContext.Set <Rider>()
                         .Where(r => r.Category != null && categoryIds.Contains(r.Category.Id) && !string.IsNullOrEmpty(r.Number))
                         .ToDictionaryAsync(r => r.Number, r => $"{r.LastName} {r.FirstName}");

            return(riders);
        }
Ejemplo n.º 2
0
 public HomeModel(RacesDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Ejemplo n.º 3
0
 public ResultLogic(RacesDbContext dataContext)
 {
     this.dataContext = dataContext;
 }
Ejemplo n.º 4
0
 public NumberService(RacesDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Ejemplo n.º 5
0
 public MainService(IRaceLogic raceLogic, RacesDbContext dbContext)
 {
     this.raceLogic = raceLogic;
     dataContext    = dbContext;
 }