public async Task <ActionResult> DeleteRoom(int projectId, int roomTypeId, int roomId)
        {
            try
            {
                await _accommodationService.DeleteRoom(roomId, projectId, roomTypeId).ConfigureAwait(false);

                return(Ok());
            }
            catch (Exception e) when(e is ArgumentException || e is JoinRpgEntityNotFoundException)
            {
            }
            catch
            {
                return(StatusCode(500));
            }
            return(BadRequest());
        }
示例#2
0
        public async Task <ActionResult> DeleteRoom(int projectId, int roomTypeId, int roomId)
        {
            try
            {
                await _accommodationService.DeleteRoom(roomId, projectId, roomTypeId).ConfigureAwait(false);

                return(new HttpStatusCodeResult(HttpStatusCode.OK));
            }
            catch (Exception e) when(e is ArgumentException || e is JoinRpgEntityNotFoundException)
            {
            }
            catch
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError));
            }
            return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
        }