Beispiel #1
0
        public async Task <bool> UpdatePossibleDisciplines(int skierId, IEnumerable <int> disciplines)
        {
            var skier = await GetSkierById(skierId);

            if (skier == null)
            {
                return(false);
            }
            using var scope = ScopeBuilder.BuildTransactionScope();
            await _skierDao.DeleteAllPossibleDisciplineForSkier(skierId);

            foreach (var discipline in disciplines)
            {
                await _skierDao.InsertPossibleDisciplineForSkier(skierId, discipline);
            }
            scope.Complete();
            return(true);
        }