/// <summary>Creates an exception.</summary> /// /// <param name="errorCode"> The error code.</param> /// <param name="errorMessage">Message describing the error.</param> /// <param name="fieldName"> Name of the field.</param> /// /// <returns>The new exception.</returns> public static ValidationError CreateException(string errorCode, string errorMessage, string fieldName) { var error = new ValidationErrorField(errorCode, fieldName, errorMessage); return(new ValidationError(new ValidationErrorResult(new List <ValidationErrorField> { error }))); }
/// <summary>Initializes a new instance of the NServiceKit.Validation.ValidationError class.</summary> /// /// <param name="validationError">The validation error.</param> public ValidationError(ValidationErrorField validationError) : this(validationError.ErrorCode, validationError.ErrorMessage) { this.Violations.Add(validationError); }
/// <summary>Creates an exception.</summary> /// /// <param name="error">The error.</param> /// /// <returns>The new exception.</returns> public static ValidationError CreateException(ValidationErrorField error) { return new ValidationError(error); }
/// <summary>Creates an exception.</summary> /// /// <param name="errorCode"> The error code.</param> /// <param name="errorMessage">Message describing the error.</param> /// <param name="fieldName"> Name of the field.</param> /// /// <returns>The new exception.</returns> public static ValidationError CreateException(string errorCode, string errorMessage, string fieldName) { var error = new ValidationErrorField(errorCode, fieldName, errorMessage); return new ValidationError(new ValidationErrorResult(new List<ValidationErrorField> { error })); }
/// <summary>Initializes a new instance of the NServiceKit.Validation.ValidationError class.</summary> /// /// <param name="validationError">The validation error.</param> public ValidationError(ValidationErrorField validationError) : this(validationError.ErrorCode, validationError.ErrorMessage) { this.Violations.Add(validationError); }
/// <summary>Creates an exception.</summary> /// /// <param name="error">The error.</param> /// /// <returns>The new exception.</returns> public static ValidationError CreateException(ValidationErrorField error) { return(new ValidationError(error)); }