/// <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); }
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()); }
public async Task <IActionResult> Delete([FromBody] RoomTypeRequestModel model) { await _roomTypeService.DeleteRoomType(model); return(Ok()); }
public IActionResult DeleteConfirmed(int id) { roomTypeService.DeleteRoomType(id); return(RedirectToAction(nameof(Index))); }