Show / Hide Table of Contents

Class ValidationOptionsResolver

A service which gets the resolved validation options.

Inheritance
System.Object
ValidationOptionsResolver
Implements
IGetsResolvedValidationOptions
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:

  1. The specified options
  2. The default options configured at DI registration
  3. Hard-coded default options (if nothing else is specified)

Constructors

| Improve this Doc View Source

ValidationOptionsResolver(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 Source

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

Implements

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