Class PropertyValidationResult
The result that must be returned from a custom validation delegate tha matches the PropertyValidationDelegate<TValue> delegate.
Inherited Members
Namespace: BionicCode.Utilities.Net
Assembly: BionicCode.Utilities.Net.Common.dll
Syntax
public class PropertyValidationResult
Constructors
| Improve this Doc View SourcePropertyValidationResult(Boolean, IEnumerable<Object>)
Constructor.
Declaration
public PropertyValidationResult(bool isValid, IEnumerable<object> errorMessages)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | isValid |
|
| IEnumerable<Object> | errorMessages | A collection of error messasge objects that can be displayed in the UI. It's expected that the client will generate one message for each validation error of the currently validated property. |
PropertyValidationResult(Boolean, Object)
Constructor.
Declaration
public PropertyValidationResult(bool isValid, object errorMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | isValid |
|
| Object | errorMessage | An error messasge object that can be displayed in the UI. |
Properties
| Improve this Doc View SourceErrorMessages
A collection of error message objects.
Declaration
public IEnumerable<object> ErrorMessages { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<Object> | It usually contains one message for each property error. |
IsValid
Returns whether tha validation was successful or has failed.
Declaration
public bool IsValid { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
|
Methods
| Improve this Doc View SourceDeconstruct(out Boolean, out IEnumerable<Object>)
Deconstructor.
Declaration
public void Deconstruct(out bool isValid, out IEnumerable<object> errorMessages)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | isValid | |
| IEnumerable<Object> | errorMessages |
Remarks
This deconstructor was mainly introduced to suppport backwards compatibility withlegacy versions where the delegate was returning a ValueTuple.