Class ValidationOptionsResolver
A service which gets the resolved validation options.
Inheritance
System.Object
ValidationOptionsResolver
Implements
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
Assembly: CSF.Validation.dll
Syntax
public class ValidationOptionsResolver : IGetsResolvedValidationOptions
Remarks
As you will notice, the ResolvedValidationOptions class has the same 'shape' as ValidationOptions, except that every property is non-nullable. The resolved options are created by taking the first non-null value from each of:
- The specified options
- The default options configured at DI registration
- Hard-coded default options (if nothing else is specified)
Constructors
| Improve this Doc View SourceValidationOptionsResolver(IOptions<ValidationOptions>)
Initialises a new instance of ValidationOptionsResolver.
Declaration
public ValidationOptionsResolver(IOptions<ValidationOptions> defaultOptions)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Options.IOptions<ValidationOptions> | defaultOptions | The default options, possibly configured during DI setup. |
Methods
| Improve this Doc View SourceGetResolvedValidationOptions(ValidationOptions)
Gets the resolved validation options.
Declaration
public ResolvedValidationOptions GetResolvedValidationOptions(ValidationOptions specifiedOptions)
Parameters
Type | Name | Description |
---|---|---|
ValidationOptions | specifiedOptions | Options which have been specified by a developer via the API; may be null. |
Returns
Type | Description |
---|---|
ResolvedValidationOptions | The resolved (or effective) validation options. |