Пример #1
0
        public async Task <TeamModel> UpdateTeamAsync(long teamId, TeamModel updatedTeam)
        {
            await GetTeamAsync(teamId);

            updatedTeam.Id = teamId;
            await _foootballRepository.UpdateTeamAsync(teamId, _mapper.Map <TeamEntity>(updatedTeam));

            var result = await _foootballRepository.SaveChangesAsync();

            if (!result)
            {
                throw new Exception("Database Error");
            }

            return(_mapper.Map <TeamModel>(updatedTeam));
        }