generated from Avanade/avanade-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathIValidationContext.cs
47 lines (40 loc) · 1.94 KB
/
IValidationContext.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
38
39
40
41
42
43
44
45
46
47
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx
using CoreEx.Entities;
using System;
using System.Collections.Generic;
namespace CoreEx.Validation
{
/// <summary>
/// Provides the validation context properties for an entity.
/// </summary>
public interface IValidationContext : IValidationResult
{
/// <summary>
/// Gets the entity <see cref="Type"/>.
/// </summary>
Type EntityType { get; }
/// <summary>
/// Gets the entity prefix used for fully qualified <i>entity.property</i> naming (<c>null</c> represents the root).
/// </summary>
string? FullyQualifiedEntityName { get; }
/// <summary>
/// Gets the entity prefix used for fully qualified JSON <i>entity.property</i> naming (<c>null</c> represents the root).
/// </summary>
string? FullyQualifiedJsonEntityName { get; }
/// <summary>
/// Indicates whether JSON names were used for the <see cref="MessageItem"/> <see cref="MessageItem.Property"/>; by default (<c>false</c>) uses the .NET property names.
/// </summary>
bool UsedJsonNames { get; }
/// <summary>
/// Gets the configuration parameters.
/// </summary>
/// <remarks>Configuration parameters provide a means to pass values down through the validation stack. The consuming developer must instantiate the property on first use.</remarks>
IDictionary<string, object?>? Config { get; }
/// <summary>
/// Determines whether one of the specified fully qualified property names has an error.
/// </summary>
/// <param name="fullyQualifiedPropertyName">The fully qualified property name.</param>
/// <returns><c>true</c> where an error exists for at least one of the specified properties; otherwise, <c>false</c>.</returns>
bool HasError(string fullyQualifiedPropertyName);
}
}