public ActionResult <bool> Delete(int id) { try { return(Ok(_repository.Delete(id))); } catch (Exception ex) { _logger.LogError($"Error: Controller exception on Delete(int id)"); return(StatusCode((int)HttpStatusCode.InternalServerError, new { Error = ex.Message })); } }
public IHttpActionResult Delete(int?id) { IHttpActionResult result; if (id != null) { repository.Delete((int)id); result = Ok(); } else { result = StatusCode(HttpStatusCode.BadRequest); } return(result); }
public IActionResult DeleteConfirmed(int id) { repo.Delete(id); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> DeleteConfirmed(int id) { IRepo.Delete(id); return(RedirectToAction(nameof(Index))); }