Class ObjectValidationResult
Defines a validation result containing all validation errors and their properties.
Inherited Members
Namespace: Swan.Validators
Syntax
public class ObjectValidationResult
Properties
Errors
A list of errors.
Declaration
public IReadOnlyList<ObjectValidationResult.ValidationError> Errors { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<ObjectValidationResult.ValidationError> |
IsValid
true
if there are no errors; otherwise, false
.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Add(String, String)
Adds an error with a specified property name.
Declaration
public void Add(string propertyName, string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The property name. |
String | errorMessage | The error message. |