Beispiel #1
0
        public async Task <HandicapConfiguration> Update(HandicapConfigurationUpdate configUpdate, string tenantId)
        {
            var config = await Get(tenantId);

            var unfinishedMatchDays = await _matchDayRepository.Find(md => md.TenantId == tenantId && !md.IsFinished);

            if (unfinishedMatchDays.Count() > 0)
            {
                throw new EntityClosedForUpdateException($"Cannot update settings. Youn have unfinished MatchDays.");
            }

            config.UpdatePlayersImmediately = configUpdate.UpdatePlayersImmediately;
            config.EightBallMax             = configUpdate.EightBallMax;
            config.NineBallMax     = configUpdate.NineBallMax;
            config.TenBallMax      = configUpdate.TenBallMax;
            config.StraigntPoolMax = configUpdate.StraigntPoolMax;

            await _configRepo.UpdateConfig(config);

            return(config);
        }
Beispiel #2
0
 public async Task <IQueryable <MatchDay> > Find(Expression <Func <MatchDay, bool> > expression, params string[] navigationProperties)
 {
     return(await _matchDayRepository.Find(expression, navigationProperties));
 }