-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathIValidator.cs
More file actions
28 lines (25 loc) · 996 Bytes
/
IValidator.cs
File metadata and controls
28 lines (25 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx
using System;
using System.Threading;
using System.Threading.Tasks;
namespace CoreEx.Validation
{
/// <summary>
/// Enables value validation.
/// </summary>
/// <remarks>Decouples <i>CoreEx</i> from any specific implementation.</remarks>
public interface IValidator
{
/// <summary>
/// Gets the <see cref="Type"/> for the value that is being validated.
/// </summary>
Type ValueType { get; }
/// <summary>
/// Validate the <paramref name="value"/> asynchronously.
/// </summary>
/// <param name="value">The value to validate.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>The <see cref="IValidationResult"/>.</returns>
Task<IValidationResult> ValidateAsync(object value, CancellationToken cancellationToken = default);
}
}