Class Helper
Provides help functionality for retrieving standard information contained within the System.ComponentModel.DataAnnotations.ValidationContext when working with a System.ComponentModel.DataAnnotations.ValidationAttribute
Inheritance
Inherited Members
Namespace: LemonEdge.API.Attributes.Validation
Assembly: API.dll
Syntax
public class Helper
Fields
CACHE_KEY
Declaration
public const string CACHE_KEY = "cache"
Field Value
Type | Description |
---|---|
System.String |
CONTEXT_KEY
Declaration
public const string CONTEXT_KEY = "context"
Field Value
Type | Description |
---|---|
System.String |
USER_KEY
Declaration
public const string USER_KEY = "user"
Field Value
Type | Description |
---|---|
System.String |
Methods
GetValidationContextItems(ValidationContext)
Returns the standard properties (An IEntityUpdater context, cache and user) held within a System.ComponentModel.DataAnnotations.ValidationContext
Declaration
public static (IEntityUpdater Updater, IReadOnlyCache Cache, UserInfo User) GetValidationContextItems(ValidationContext context)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.DataAnnotations.ValidationContext | context | The validation context to retrieve standard properties from the dictionary property bag |
Returns
Type | Description |
---|---|
System.ValueTuple<IEntityUpdater, IReadOnlyCache, UserInfo> | The standard properties (An IEntityUpdater context, cache and user) held within a System.ComponentModel.DataAnnotations.ValidationContext |
GetValidationContextItems(Object, IReadOnlyCache, UserInfo)
Returns a dictionary of properties that can be user within a System.ComponentModel.DataAnnotations.ValidationContext
Declaration
public static Dictionary<object, object> GetValidationContextItems(object context, IReadOnlyCache cache, UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
System.Object | context | The context to add to the dictionary for the System.ComponentModel.DataAnnotations.ValidationContext |
IReadOnlyCache | cache | The cache to add to the dictionary for the System.ComponentModel.DataAnnotations.ValidationContext |
UserInfo | user | The user to add to the dictionary for the System.ComponentModel.DataAnnotations.ValidationContext |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Object, System.Object> | A dictionary of properties that can be user within a System.ComponentModel.DataAnnotations.ValidationContext |