コード例 #1
0
            public Exception HandleException(Exception exception, Guid handlingInstanceId)
            {
                var e = exception as BusinessValidationException;

                if (e != null)
                {
                    var list = from error in e.Errors ?? new ValidationFailureInfo[0]
                               select new ValidationFailure(
                        error.PropertyName,
                        error.ErrorMessage,
                        error.ErrorCode,
                        error.AttemptedValue);
                    exception = new ServiceStack.FluentValidation.ValidationException(list);
                }

                return(exception);
            }
コード例 #2
0
            public Exception HandleException(Exception exception, Guid handlingInstanceId)
            {
                var e = exception as BusinessValidationException;
                if (e != null)
                {
                    var list = from error in e.Errors ?? new ValidationFailureInfo[0]
                               select new ValidationFailure(
                                   error.PropertyName,
                                   error.ErrorMessage,
                                   error.ErrorCode,
                                   error.AttemptedValue);
                    exception = new ServiceStack.FluentValidation.ValidationException(list);
                }

                return exception;
            }