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)); } }
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)); } }