public UseCaseResponse <T> SetRequestValidatorError(IEnumerable <ValidationFailure> validationErrors)
        {
            this.Status = UseCaseResponseStatus.ValidateError;
            var errors = validationErrors.Select(x => new ErrorMessage(x.ErrorCode, x.ErrorMessage));

            return(this.SetErrors(errors));
        }
 public UseCaseResponse <T> SetResourceNotFountError(IEnumerable <ErrorMessage> errors = null)
 {
     this.Status = UseCaseResponseStatus.ResourceNotFountError;
     return(this.SetErrors(errors));
 }
 public UseCaseResponse <T> SetResourceNotFountError(string errorCode, string errorMessage)
 {
     this.Status = UseCaseResponseStatus.ResourceNotFountError;
     return(this.SetErrors(new ErrorMessage[] { new ErrorMessage(errorCode, errorMessage) }));
 }
 public UseCaseResponse <T> SetGenericError(IEnumerable <ErrorMessage> errors)
 {
     this.Status = UseCaseResponseStatus.ExceptionError;
     return(this.SetErrors(errors));
 }
 public UseCaseResponse <T> SetResult(T result)
 {
     this.Status = UseCaseResponseStatus.Success;
     this.Result = result;
     return(this);
 }
Example #6
0
 public GetInvoiceByCodeResponse(UseCaseResponseStatus status, FullInvoice result = null) : base(status)
 {
     Result = result;
 }
Example #7
0
 protected UseCaseResponseMessage(UseCaseResponseStatus status)
 {
     Status = status;
 }