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); }
public HomeModel(RacesDbContext dbContext) { this.dbContext = dbContext; }
public ResultLogic(RacesDbContext dataContext) { this.dataContext = dataContext; }
public NumberService(RacesDbContext dbContext) { this.dbContext = dbContext; }
public MainService(IRaceLogic raceLogic, RacesDbContext dbContext) { this.raceLogic = raceLogic; dataContext = dbContext; }