Show / Hide Table of Contents

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>.

Inheritance
System.Object
RuleResult
ValidationRuleResult
Inherited Members
RuleResult.RuleTimeoutDataKey
RuleResult.Outcome
RuleResult.IsPass
RuleResult.Data
RuleResult.Exception
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: CSF.Validation
Assembly: CSF.Validation.Abstractions.dll
Syntax
public class ValidationRuleResult : RuleResult
Remarks

This class is a more complete version of RuleResult. Where the rule result only contains the information which would be directly output from the rule itself, this class provides more contextual information which may be 'backfilled' by the validation framework.

Constructors

| Improve this Doc View Source

ValidationRuleResult(RuleResult, RuleContext, IValidationLogic, String, RuleInstrumentationData)

Initializes a new instance of the ValidationRuleResult class.

Declaration
public ValidationRuleResult(RuleResult result, RuleContext ruleContext, IValidationLogic validationLogic, string message = null, RuleInstrumentationData instrumentationData = null)
Parameters
Type Name Description
RuleResult result

The rule result.

RuleContext ruleContext

The rule context.

IValidationLogic validationLogic

The validation logic for the rule.

System.String message

The human-readable validation feedback message.

RuleInstrumentationData instrumentationData

Optional instrumentation data.

Remarks

This constructor copies-information-from and then enriches a RuleResult with further information.

Properties

| Improve this Doc View Source

Identifier

Gets a unique identifier for the rule to which this result corresponds.

Declaration
public RuleIdentifier Identifier { get; }
Property Value
Type Description
RuleIdentifier
| Improve this Doc View Source

InstrumentationData

Gets optional instrumentation data about how the current rule executed.

Declaration
public RuleInstrumentationData InstrumentationData { get; }
Property Value
Type Description
RuleInstrumentationData
Remarks

This data is only collected and added to the validation rule result if InstrumentRuleExecution is set to true.

| Improve this Doc View Source

Message

Gets a human-readable feedback message to be associated with this rule result.

Declaration
public string Message { get; }
Property Value
Type Description
System.String
Remarks

This property will always contain a null reference unless ResolvedValidationOptions are specified and the EnableMessageGeneration is set to true. If the options are not specified or message generation is not enabled, then generation of feedback messages is disabled/skipped.

| Improve this Doc View Source

RuleContext

Gets contextual information about this rule.

Declaration
public RuleContext RuleContext { get; }
Property Value
Type Description
RuleContext
| Improve this Doc View Source

RuleInterface

Gets a reference to the System.Type of rule interface which was used for this rule.

Declaration
public Type RuleInterface { get; }
Property Value
Type Description
System.Type
Remarks

This will be a closed-generic form of either IRule<TValidated> or IRule<TValue, TParent>.

| Improve this Doc View Source

ValidatedValue

Gets the actual value which was validated by this rule.

Declaration
public object ValidatedValue { get; }
Property Value
Type Description
System.Object
| Improve this Doc View Source

ValidationLogic

Gets a reference to the validation rule logic.

Declaration
public IValidationLogic ValidationLogic { get; }
Property Value
Type Description
IValidationLogic

Methods

| Improve this Doc View Source

ToString()

Gets a string representation of the current instance.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string representation of the current object.

Overrides
RuleResult.ToString()
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX