public JsonResult CreateRoomCost(int hotelID, int quality) { try { var hotel = hotelRepository.GetById(hotelID); if (hotel == null) { return(JsonError("Not found")); } return(JsonData( hotelService.CalculateConstructionCostForNewRoom(hotel, quality))); } catch (Exception e) { return(JsonDebugOnlyError(e)); } }