Class ValidationScope
The Scope of a set of Validation Rules determines when those rules will be triggered, and can optionally also apply a Condition (which is an expression evaluated against the Entity being validated)
public abstract class ValidationScope
- Inheritance
-
ValidationScope
- Derived
- Inherited Members
Properties
CommandKeys
Identifies the commands that will trigger the validation rules when the OnCommand trigger has been specified. The CommandKey will typically be the text on the command button, and only needs to be
public ISet<string> CommandKeys { get; protected init; }
Property Value
Remarks
Set by calling the OnCommand(commandKeys) method
HasCondition
public virtual bool HasCondition { get; }
Property Value
Severity
public ValidationSeverity Severity { get; protected init; }
Property Value
SummaryMessage
public string? SummaryMessage { get; protected init; }
Property Value
Triggers
public ISet<ValidationScope.TriggerEnum> Triggers { get; protected init; }
Property Value
Methods
EvaluateCondition(IServices, IEntity?)
public virtual bool EvaluateCondition(IServices services, IEntity? entity)
Parameters
Returns
HasCommandTrigger(string)
public bool HasCommandTrigger(string commandKey)
Parameters
commandKeystring
Returns
HasTrigger(TriggerEnum)
public bool HasTrigger(ValidationScope.TriggerEnum trigger)
Parameters
triggerValidationScope.TriggerEnum
Returns
OnChanged()
public static WrappedValidationScope<IEntity> OnChanged()
Returns
OnCommand(params string[])
public static WrappedValidationScope<IEntity> OnCommand(params string[] commandKeys)
Parameters
commandKeysstring[]
Returns
OnLostFocus()
public static WrappedValidationScope<IEntity> OnLostFocus()
Returns
OnRender()
public static WrappedValidationScope<IEntity> OnRender()
Returns
OnSave()
public static WrappedValidationScope<IEntity> OnSave()
Returns
WithSummaryMessage(string)
Allows specifying a summary message for the validation rules in the scope
public static WrappedValidationScope<IEntity> WithSummaryMessage(string message)
Parameters
messagestring