Class ValidationResult
Represents the result of a validation operation.
Inheritance
System.Object
ValidationResult
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: MediatorForge.Utilities
Assembly: MediatorForge.dll
Syntax
public class ValidationResult
Constructors
| Improve this Doc View SourceValidationResult(IEnumerable<ValidationError>)
Initializes a new instance of the ValidationResult class with a collection of validation errors.
Declaration
public ValidationResult(IEnumerable<ValidationError> errors)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ValidationError> | errors | The collection of validation errors. |
Properties
| Improve this Doc View SourceErrors
Gets the collection of validation errors.
Declaration
public IEnumerable<ValidationError> Errors { get; }
Property Value
Type | Description |
---|---|
IEnumerable<ValidationError> |
IsValid
Gets a value indicating whether the validation was successful.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Success
Gets a ValidationResult that represents a successful validation.
Declaration
public static ValidationResult Success { get; }
Property Value
Type | Description |
---|---|
ValidationResult |
Methods
| Improve this Doc View SourceFailure(IEnumerable<ValidationError>)
Creates a ValidationResult that represents a failed validation with the specified errors.
Declaration
public static ValidationResult Failure(IEnumerable<ValidationError> errors)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ValidationError> | errors | The collection of validation errors. |
Returns
Type | Description |
---|---|
ValidationResult | A ValidationResult that represents a failed validation. |