Example #1
0
        public void Delete(int id)
        {
            var request = new DeleteRoomRequest();

            request.Id = id;
            var response = HttpPost <DeleteRoomRequest>("api/room/delete", request, MediaType.Json);
        }
 public ActionResult Delete([FromBody] DeleteRoomRequest request)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest());
     }
     try
     {
         _roomService.Delete(request.Id);
         return(NoContent());
     }
     catch (Exception error)
     {
         _logger.LogError(error.ToString());
         return(BadRequest());
     }
 }
Example #3
0
 public void delete(DeleteRoomRequest request)
 {
     try
     {
         var response = new DeleteRoomResponse();
         var bc       = new RoomComponent();
         bc.Delete(request.Id);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
Example #4
0
 public Task <DeleteRoomResponse> DeleteRoomAsync(DeleteRoomRequest request)
 {
     return(WeChatMiniProgramApiRequester.RequestAsync <DeleteRoomResponse>(DeleteRoomUrl,
                                                                            HttpMethod.Post,
                                                                            request));
 }
 /// <summary>
 ///  删除房间
 ///
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public async Task <DeleteRoomResponse> DeleteRoom(DeleteRoomRequest request)
 {
     return(await new DeleteRoomExecutor().Client(this).Execute <DeleteRoomResponse, DeleteRoomResult, DeleteRoomRequest>(request).ConfigureAwait(false));
 }
 /// <summary>
 ///  删除房间
 ///
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public DeleteRoomResponse DeleteRoom(DeleteRoomRequest request)
 {
     return(new DeleteRoomExecutor().Client(this).Execute <DeleteRoomResponse, DeleteRoomResult, DeleteRoomRequest>(request));
 }