Example #1
0
 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());
     }
 }
Example #2
0
 public IActionResult Delete(int id)
 {
     return(CategoriaBL.Delete(id) ? Ok("La categoria se ha borrado con éxito") : (IActionResult)NotFound());
 }