コード例 #1
0
 /// <summary>
 /// Delete an item from the list
 /// </summary>
 /// <param name=<em>"id"</em>>id of the item to be deleted</param>
 // DELETE: api/RoomType/5
 public bool Delete(int id)
 {
     if (id >= 0)
     {
         return(_RoomTypeService.DeleteRoomType(id));
     }
     return(false);
 }
コード例 #2
0
        public IActionResult DeleteConfirmed(int?Id)
        {
            var roomType = IRoomTypeService.GetRoomType((int)Id);

            if (roomType == null)
            {
                return(NotFound());
            }
            try
            {
                IRoomTypeService.DeleteRoomType((int)Id);
                return(RedirectToAction("Index"));
            }
            catch (Exception)
            {
                return(RedirectToAction(nameof(Delete), new { id = Id, saveChangesError = true }));
            }
        }
        public async Task <IActionResult> DeleteRoomType(RoomType roomType)
        {
            await _roomTypeService.DeleteRoomType(roomType);

            return(Ok());
        }
コード例 #4
0
        public async Task <IActionResult> Delete([FromBody] RoomTypeRequestModel model)
        {
            await _roomTypeService.DeleteRoomType(model);

            return(Ok());
        }
コード例 #5
0
 public IActionResult DeleteConfirmed(int id)
 {
     roomTypeService.DeleteRoomType(id);
     return(RedirectToAction(nameof(Index)));
 }