Class ValidationRuleResult
Represents information about the result of running a single validation rule. Typically this is a class which implements either IRule<TValidated> or IRule<TValue, TParent>.
Inherited Members
Namespace: CSF.Validation
Assembly: CSF.Validation.Abstractions.dll
Syntax
public class ValidationRuleResult : RuleResult
Remarks
This class is a more complete version of Rule
Constructors
| Improve this Doc View SourceValidationRuleResult(RuleResult, RuleContext, IValidationLogic, String, RuleInstrumentationData)
Initializes a new instance of the Validation
Declaration
public ValidationRuleResult(RuleResult result, RuleContext ruleContext, IValidationLogic validationLogic, string message = null, RuleInstrumentationData instrumentationData = null)
Parameters
Type | Name | Description |
---|---|---|
Rule |
result | The rule result. |
Rule |
ruleContext | The rule context. |
IValidation |
validationLogic | The validation logic for the rule. |
System. |
message | The human-readable validation feedback message. |
Rule |
instrumentationData | Optional instrumentation data. |
Remarks
This constructor copies-information-from and then enriches a Rule
Properties
| Improve this Doc View SourceIdentifier
Gets a unique identifier for the rule to which this result corresponds.
Declaration
public RuleIdentifier Identifier { get; }
Property Value
Type | Description |
---|---|
Rule |
InstrumentationData
Gets optional instrumentation data about how the current rule executed.
Declaration
public RuleInstrumentationData InstrumentationData { get; }
Property Value
Type | Description |
---|---|
Rule |
Remarks
This data is only collected and added to the validation rule result if Instrument
Message
Gets a human-readable feedback message to be associated with this rule result.
Declaration
public string Message { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
This property will always contain a null reference unless Resolved
RuleContext
Gets contextual information about this rule.
Declaration
public RuleContext RuleContext { get; }
Property Value
Type | Description |
---|---|
Rule |
RuleInterface
Gets a reference to the System.
Declaration
public Type RuleInterface { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
This will be a closed-generic form of either IRule<TValidated> or IRule<TValue, TParent>.
ValidatedValue
Gets the actual value which was validated by this rule.
Declaration
public object ValidatedValue { get; }
Property Value
Type | Description |
---|---|
System. |
ValidationLogic
Gets a reference to the validation rule logic.
Declaration
public IValidationLogic ValidationLogic { get; }
Property Value
Type | Description |
---|---|
IValidation |
Methods
| Improve this Doc View SourceToString()
Gets a string representation of the current instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |
A string representation of the current object. |