Class ValidationHelper
Inheritance
ValidationHelper
Assembly: LemonEdge.API.dll
Syntax
public class ValidationHelper
Constructors
ValidationHelper()
Declaration
public ValidationHelper()
Fields
BATCH_ITEMS_KEY
Declaration
public const string BATCH_ITEMS_KEY = "batch"
Field Value
BATCH_ITEMS_VALIDATED_KEY
Declaration
public const string BATCH_ITEMS_VALIDATED_KEY = "batch-validated"
Field Value
CACHE_KEY
Declaration
public const string CACHE_KEY = "cache"
Field Value
CONTEXT_KEY
Declaration
public const string CONTEXT_KEY = "context"
Field Value
USER_KEY
Declaration
public const string USER_KEY = "user"
Field Value
Methods
AddBatchItemsValidated(IDictionary<object, object>, ValidationAttribute, string)
Declaration
public static void AddBatchItemsValidated(IDictionary<object, object> context, ValidationAttribute attributeBatchValidated, string key)
Parameters
AddItemsForBatchValidation(IDictionary<object, object>, IEnumerable<IBaseEntity>)
Declaration
public static void AddItemsForBatchValidation(IDictionary<object, object> context, IEnumerable<IBaseEntity> items)
Parameters
AreBatchItemsValidated(IDictionary<object, object>, ValidationAttribute, string)
Declaration
public static bool AreBatchItemsValidated(IDictionary<object, object> context, ValidationAttribute attributeBatchValidated, string key)
Parameters
Returns
GetItemsForBatchValidation(IDictionary<object, object>)
Declaration
public static IEnumerable<IBaseEntity> GetItemsForBatchValidation(IDictionary<object, object> context)
Parameters
Returns
GetValidationContextItems(ValidationContext)
Declaration
public static (IEntityUpdater Updater, IReadOnlyCache Cache, UserInfo User) GetValidationContextItems(ValidationContext context)
Parameters
Type |
Name |
Description |
ValidationContext |
context |
The validation context to retrieve standard properties from the dictionary property bag
|
Returns
GetValidationContextItems(object, IReadOnlyCache, UserInfo)
Declaration
public static Dictionary<object, object> GetValidationContextItems(object context, IReadOnlyCache cache, UserInfo user)
Parameters
Returns
TryValidate(IReadOnlyCache, UserInfo, IServiceContext, IEntityRetriever, IEnumerable<IBaseEntity>, IEnumerable<IBaseEntity>, IEnumerable<IBaseEntity>, IEnumerable<IBaseEntity>, List<ValidationResult>, bool)
Declaration
public static Task<bool> TryValidate(IReadOnlyCache cache, UserInfo user, IServiceContext services, IEntityRetriever context, IEnumerable<IBaseEntity> newItems, IEnumerable<IBaseEntity> updatedItems, IEnumerable<IBaseEntity> deletedItems, IEnumerable<IBaseEntity> exemptFromValidations, List<ValidationResult> failed, bool returnOnFirstError)
Parameters
Returns
Validate(IReadOnlyCache, UserInfo, IServiceContext, IEntityRetriever, IEnumerable<IBaseEntity>, IEnumerable<IBaseEntity>, IEnumerable<IBaseEntity>, IEnumerable<IBaseEntity>)
Declaration
public static Task Validate(IReadOnlyCache cache, UserInfo user, IServiceContext services, IEntityRetriever context, IEnumerable<IBaseEntity> newItems, IEnumerable<IBaseEntity> updatedItems, IEnumerable<IBaseEntity> deletedItems, IEnumerable<IBaseEntity> exemptFromValidations)
Parameters
Returns
Extension Methods