예제 #1
0
        public async Task <ResponseDto <BaseModelDto> > EditLeagueAsync(int leagueId, EditLeagueBindingModel model)
        {
            var response = new ResponseDto <BaseModelDto>();

            var league = _leagueRepository.GetById(leagueId);

            if (league == null)
            {
                response.Errors.Add(ServiceErrors.LEAGUE_DOESNT_EXIST);
                return(response);
            }
            league.Name = model.Name;
            await _leagueRepository.EditAsync(league);

            return(response);
        }