Interface IGetsValueToBeValidated
An object which gets the value to be validated: the "actual" value.
Namespace: CSF.Validation.RuleExecution
Assembly: CSF.Validation.Abstractions.dll
Syntax
public interface IGetsValueToBeValidated
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
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. |