Show / Hide Table of Contents

# Class OpenIddictValidationHandlerDescriptor.Builder<TContext>

Contains methods allowing to build a descriptor instance.

##### Inheritance

System.Object
OpenIddictValidationHandlerDescriptor.Builder<TContext>

##### 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.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)

###### Namespace: OpenIddict.Validation

###### Assembly: cs.temp.dll.dll

##### Syntax

    public class Builder<TContext>
        where TContext : BaseContext

##### Type Parameters

Name | Description
--- | ---
TContext | The event context type.

### Methods

#### AddFilter(Type)

Adds the type of a handler filter to the filters list.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> AddFilter(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The event handler filter type.

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

#### AddFilter<TFilter>()

Adds the type of a handler filter to the filters list.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> AddFilter<TFilter>()
        where TFilter : IOpenIddictValidationHandlerFilter<TContext>

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

##### Type Parameters

Name | Description
--- | ---
TFilter | The event handler filter type.

#### Build()

Build a new descriptor instance, based on the parameters that were previously set.

##### Declaration

    public OpenIddictValidationHandlerDescriptor Build()

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor | The builder instance, so that calls can be easily chained.

#### Import(OpenIddictValidationHandlerDescriptor)

Imports the properties set on the specified descriptor.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> Import(OpenIddictValidationHandlerDescriptor descriptor)

##### Parameters

Type | Name | Description
--- | --- | ---
OpenIddictValidationHandlerDescriptor | descriptor | The existing descriptor properties are copied from.

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

##### Remarks

All the properties previously set on this instance are automatically replaced.

#### SetOrder(Int32)

Sets the order in which the event handler will be invoked.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> SetOrder(int order)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | order | The handler order.

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

#### SetServiceDescriptor(ServiceDescriptor)

Sets the service descriptor.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> SetServiceDescriptor(ServiceDescriptor descriptor)

##### Parameters

Type | Name | Description
--- | --- | ---
ServiceDescriptor | descriptor | The service descriptor.

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

#### SetType(OpenIddictValidationHandlerType)

Sets the type associated to the handler.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> SetType(OpenIddictValidationHandlerType type)

##### Parameters

Type | Name | Description
--- | --- | ---
OpenIddictValidationHandlerType | type | The handler type.

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

#### UseInlineHandler(Func<TContext, ValueTask>)

Configures the descriptor to use the specified inline handler.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> UseInlineHandler(Func<TContext, ValueTask> handler)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<TContext, ValueTask> | handler | The handler instance.

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

#### UseScopedHandler<THandler>()

Configures the descriptor to use the specified scoped handler.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> UseScopedHandler<THandler>()
        where THandler : IOpenIddictValidationHandler<TContext>

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

##### Type Parameters

Name | Description
--- | ---
THandler | The handler type.

#### UseScopedHandler<THandler>(Func<IServiceProvider, Object>)

Configures the descriptor to use the specified scoped handler.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> UseScopedHandler<THandler>(Func<IServiceProvider, object> factory)
        where THandler : IOpenIddictValidationHandler<TContext>

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<System.IServiceProvider, System.Object> | factory | The factory used to create the handler.

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

##### Type Parameters

Name | Description
--- | ---
THandler | The handler type.

#### UseSingletonHandler<THandler>()

Configures the descriptor to use the specified singleton handler.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> UseSingletonHandler<THandler>()
        where THandler : IOpenIddictValidationHandler<TContext>

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

##### Type Parameters

Name | Description
--- | ---
THandler | The handler type.

#### UseSingletonHandler<THandler>(THandler)

Configures the descriptor to use the specified singleton handler.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> UseSingletonHandler<THandler>(THandler handler)
        where THandler : IOpenIddictValidationHandler<TContext>

##### Parameters

Type | Name | Description
--- | --- | ---
THandler | handler | The handler instance.

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

##### Type Parameters

Name | Description
--- | ---
THandler | The handler type.

#### UseSingletonHandler<THandler>(Func<IServiceProvider, Object>)

Configures the descriptor to use the specified singleton handler.

##### Declaration

    public OpenIddictValidationHandlerDescriptor.Builder<TContext> UseSingletonHandler<THandler>(Func<IServiceProvider, object> factory)
        where THandler : IOpenIddictValidationHandler<TContext>

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<System.IServiceProvider, System.Object> | factory | The factory used to create the handler.

##### Returns

Type | Description
--- | ---
OpenIddictValidationHandlerDescriptor.Builder<TContext> | The builder instance, so that calls can be easily chained.

##### Type Parameters

Name | Description
--- | ---
THandler | The handler type.