public IActionResult Delete(int id)
 {
     if (id < 0)
     {
         return(NotFound("Id not valid"));
     }
     else
     {
         try
         {
             Administrator admin = adminLogic.Get(id);
             adminLogic.Delete(admin);
             return(Ok("Erased successfully"));
         }
         catch (EntityNotExists fe)
         {
             return(NotFound(fe.MessageError()));
         }
         catch (Exception e)
         {
             return(StatusCode(StatusCodes.Status500InternalServerError, e.Message));
         }
     }
 }
Ejemplo n.º 2
0
 public IActionResult Delete(int id)
 {
     AdministratorLogic.Delete(id);
     return(NoContent());
 }