예제 #1
0
 public IActionResult Delete(int id)
 {
     try
     {
         var result = UsuarioBusiness.Delete(id);
         if (result == true)
         {
             return(NoContent());
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception msg)
     {
         return(BadRequest("ERROR IN PROCESS THE REQUEST" + msg.Message));
     }
 }
예제 #2
0
        public ActionResult <Usuario> DeleteUsuario(Guid id)
        {
            var usuarioExiste = UsuarioExists(id);

            if (!usuarioExiste)
            {
                return(NotFound());
            }

            try
            {
                _usuarioBusiness.Delete(id);
                _unitOfWork.Commit();
                return(Ok(id));
            }
            catch (Exception ex)
            {
                _unitOfWork.Rollback();
                return(Conflict(ex.Message));
            }
        }
예제 #3
0
 public IActionResult Delete(long id)
 {
     _usuarioBusiness.Delete(id);
     return(NoContent());
 }