コード例 #1
0
        public async Task <IActionResult> AddCinemaAsync(UpsertCinemaRequest request)
        {
            try
            {
                int result = await _cinemaService.UpsertCinemaAsync(
                    request.Adapt <CinemaModel>()
                    );

                return(Ok(
                           result
                           ));
            }
            catch (ConflictException e)
            {
                return(Conflict(e.Message));
            }
        }
コード例 #2
0
        public async Task <IActionResult> EditCinemaAsync(UpsertCinemaRequest request)
        {
            if (!await _cityService.CheckId(request.Id))
            {
                return(BadRequest());
            }

            try
            {
                int result = await _cityService.UpsertCityAsync(
                    request.Adapt <CityModel>()
                    );

                return(Ok(
                           result
                           ));
            }
            catch (ConflictException e)
            {
                return(Conflict(e.Message));
            }
        }