Ejemplo n.º 1
0
        public async Task <IActionResult> Delete(long Id)
        {
            var result = await _estudianteService.DeleteEstudiante(Id);

            var response = new APIResponse <bool>(result);

            return(Ok(response));
        }
Ejemplo n.º 2
0
 public ActionResult <bool> DeleteEstudiante(int id)
 {
     try
     {
         var result = estudianteService.DeleteEstudiante(id);
         if (!result)
         {
             return(StatusCode(StatusCodes.Status500InternalServerError, "cannot delete author"));
         }
         return(Ok(result));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
     }
 }
 public ActionResult DeleteEstudiante(int id, FormCollection form)
 {
     _ServiceEst.DeleteEstudiante(id);
     return(RedirectToAction("Index"));
 }
 public ActionResult DeleteEstudiante(int id, FormCollection form)
 {
     _serviceEst.DeleteEstudiante(id);
     return(Json(new { response = true, message = "Registro borrado", href = "~/Estudiante" }, JsonRequestBehavior.AllowGet));
 }