public virtual DeleteUserByIdResponse DeleteUserById(DeleteUserByIdRequest request) { var response = new DeleteUserByIdResponse(); try { // Raise Initialization Event var initialization = DeleteUserByIdInitialization; if (initialization != null) { initialization(request, response); } // Raise Execute Event var execute = DeleteUserByIdExecute; if (execute != null) { response = execute(request); } // Raise Complete Event var complete = DeleteUserByIdComplete; if (complete != null) { complete(request, response); } } catch (Exception exception) { // Raise Error Event var error = DeleteUserByIdError; if (error != null) { error(request, response, exception); } } return(response); }
public override DeleteUserByIdResponse OnDeleteUserByIdExecute(DeleteUserByIdRequest request) { DeleteUserByIdResponse response = new DeleteUserByIdResponse(); try { var spec = new UsuarioByIdSpec(request.Id); var user = _usuarioRepository.Get(spec); _usuarioRepository.Delete(user); _unitOfWork.Commit(); } catch (Exception ex) { response.Exception = ex; } return(response); }
public DeleteUserByIdResponse DeleteUserById(DeleteUserByIdRequest request) { DeleteUserByIdResponse response = new DeleteUserByIdResponse(); try { new EFUserMethodsCAP().DeleteUserById(request.Id); response.Result = new Ac4yProcessResult() { Code = Ac4yProcessResult.SUCCESS, Message = "user törölve" }; } catch (Exception exception) { response.Result = (new Ac4yProcessResult() { Code = Ac4yProcessResult.FAIL, Message = exception.Message, Description = exception.StackTrace }); } return(response); }