public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here categoriaBL.Delete(id); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Error = ex.Message; return(View()); } }
public IActionResult Delete(int id) { return(CategoriaBL.Delete(id) ? Ok("La categoria se ha borrado con éxito") : (IActionResult)NotFound()); }