Class ValueToBeValidatedProvider
A service which gets the value to be validated: the "actual" value.
Inheritance
Implements
Inherited Members
Namespace: CSF.Validation.RuleExecution
Assembly: CSF.Validation.dll
Syntax
public class ValueToBeValidatedProvider : IGetsValueToBeValidated
Constructors
| Improve this Doc View SourceValueToBeValidatedProvider(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 |
Methods
| Improve this Doc View SourceGetValueToBeValidated(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. |