-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
IValidator.cs
37 lines (32 loc) · 1.15 KB
/
IValidator.cs
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
29
30
31
32
33
34
35
36
37
// MADE Apps licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace MADE.Data.Validation
{
/// <summary>
/// Defines an interface for a data validator.
/// </summary>
public interface IValidator
{
/// <summary>
/// Gets or sets the key associated with the validator.
/// </summary>
string Key { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the data provided is in an invalid state.
/// </summary>
bool IsInvalid { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the data is dirty.
/// </summary>
bool IsDirty { get; set; }
/// <summary>
/// Gets or sets the feedback message to display when <see cref="IsInvalid"/> is true.
/// </summary>
string FeedbackMessage { get; set; }
/// <summary>
/// Executes data validation on the provided <paramref name="value"/>.
/// </summary>
/// <param name="value">The value to be validated.</param>
void Validate(object value);
}
}