public IActionResult AddRegion(HotelRegion region) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var returnRegion = _hotelsRepository.Add(region); return(Ok(returnRegion)); }
public IActionResult Remove(HotelRegionSearcher region) { if (region.Id == null) { return(BadRequest(ModelState)); } HotelRegion temp = null; try { temp = _hotelsRepository.Remove(region.ToHotelRegion()); } catch (InvalidOperationException ioe) { return(NotFound(ioe.Message)); } return(Ok(temp)); }