public IHttpActionResult Delete(Guid id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (dataAccess.Delete(id) == false) { return(NotFound()); } return(Ok()); }
public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here var res = ac.Delete(id); if (res) { return(RedirectToAction("Index", "Account")); } else { ModelState.AddModelError("", "Delete thất bại"); } return(RedirectToAction("Index")); } catch { return(View()); } }