public IActionResult Delete(int?id) { int result = 0; if (id == null) { return(BadRequest()); } try { result = acontext.Delete(id); if (result == 0) { return(NotFound()); } return(Ok()); } catch (Exception) { return(BadRequest()); } }