Show / Hide Table of Contents

Class ValueToBeValidatedProvider

A service which gets the value to be validated: the "actual" value.

Inheritance
System.Object
ValueToBeValidatedProvider
Implements
IGetsValueToBeValidated
Inherited Members
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)
System.Object.ToString()
Namespace: CSF.Validation.RuleExecution
Assembly: CSF.Validation.dll
Syntax
public class ValueToBeValidatedProvider : IGetsValueToBeValidated

Constructors

| Improve this Doc View Source

ValueToBeValidatedProvider(IGetsAccessorExceptionBehaviour)

Initialises a new instance of ValueToBeValidatedProvider.

Declaration
public ValueToBeValidatedProvider(IGetsAccessorExceptionBehaviour behaviourProvider)
Parameters
Type Name Description
IGetsAccessorExceptionBehaviour behaviourProvider

The exception behaviour provider.

Exceptions
Type Condition
System.ArgumentNullException

If the behaviourProvider is null.

Methods

| Improve this Doc View Source

GetValueToBeValidated(ManifestItem, Object, ResolvedValidationOptions)

Attempts to get the value to be validatded from the specified manifest value and parent value instance.

Declaration
public GetValueToBeValidatedResponse GetValueToBeValidated(ManifestItem manifestValue, object parentValue, ResolvedValidationOptions validationOptions)
Parameters
Type Name Description
ManifestItem manifestValue

The manifest value describing the value.

System.Object parentValue

The previous/parent value, from which the validated value should be derived.

ResolvedValidationOptions validationOptions

Validation options.

Returns
Type Description
GetValueToBeValidatedResponse

A result object which indicates success/failure and provides further contextual information.

Remarks

This method returns a result object indicating the outcome of the attempt. Three different concrete classes may be returned by this method.

  • SuccessfulGetValueToBeValidatedResponse if the attempt is a success.
  • ErrorGetValueToBeValidatedResponse if the attempt failed and this should result in an error being added to the validation result.
  • IgnoredGetValueToBeValidatedResponse if the attempt failed but this should be silently ignored.

This method might also raise a ValidationException if the attempt fails and the error-handling behaviour (decided between the manifest value and validation options) is Throw.

Exceptions
Type Condition
ValidationException

If the attempt fails and the error-handling behaviour is Throw.

Implements

IGetsValueToBeValidated
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX