Class AsyncValidatorCollection
- Namespace
- MADE.Data.Validation
- Assembly
- MADE.Data.Validation.dll
Defines a list of IAsyncValidator objects that can be accessed by index.
public class AsyncValidatorCollection : List<IAsyncValidator>, IList<IAsyncValidator>, ICollection<IAsyncValidator>, IReadOnlyList<IAsyncValidator>, IReadOnlyCollection<IAsyncValidator>, IEnumerable<IAsyncValidator>, IList, ICollection, IEnumerable
- Inheritance
-
AsyncValidatorCollection
- Implements
- Inherited Members
- Extension Methods
Constructors
AsyncValidatorCollection()
Initializes a new instance of the AsyncValidatorCollection class that is empty and has the default initial capacity.
public AsyncValidatorCollection()
AsyncValidatorCollection(IEnumerable<IAsyncValidator>)
Initializes a new instance of the AsyncValidatorCollection class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
public AsyncValidatorCollection(IEnumerable<IAsyncValidator> collection)
Parameters
collectionIEnumerable<IAsyncValidator>The collection whose elements are copied to the new list.
Exceptions
- ArgumentNullException
collectionis null.
AsyncValidatorCollection(int)
Initializes a new instance of the AsyncValidatorCollection class that is empty and has the specified initial capacity.
public AsyncValidatorCollection(int capacity)
Parameters
capacityintThe number of elements that the new list can initially store.
Exceptions
- ArgumentOutOfRangeException
capacityis less than 0.
Properties
FeedbackMessages
Gets the validator feedback messages for ones which are invalid.
public IEnumerable<string> FeedbackMessages { get; }
Property Value
IsDirty
Gets or sets a value indicating whether the data is dirty.
public bool IsDirty { get; set; }
Property Value
IsInvalid
Gets or sets a value indicating whether the data provided is in an invalid state.
public bool IsInvalid { get; set; }
Property Value
Methods
ValidateAsync(object, CancellationToken)
Executes data validation on the provided value against the validators provided asynchronously.
public Task ValidateAsync(object value, CancellationToken cancellationToken = default)
Parameters
valueobjectThe value to be validated.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task
An asynchronous operation.
Exceptions
Events
Validated
Occurs when the input value is validated against the collection of validators.
public event InputValidatedEventHandler? Validated