Table of Contents

Class DispatcherBuilderExtensions

Namespace
IceRpc.Extensions.DependencyInjection
Assembly
IceRpc.dll

Provides extension methods for IDispatcherBuilder to add a middleware that sets a feature.

public static class DispatcherBuilderExtensions
Inheritance
DispatcherBuilderExtensions
Inherited Members

Methods

Map<TService>(IDispatcherBuilder)

Registers a route to a service that uses the service's default path as the route path. If there is an existing route at the same path, it is replaced.

public static IDispatcherBuilder Map<TService>(this IDispatcherBuilder builder) where TService : notnull

Parameters

builder IDispatcherBuilder

The builder being configured.

Returns

IDispatcherBuilder

This builder.

Type Parameters

TService

The type of the DI service that will handle the requests. The implementation of this service must implement IDispatcher.

Remarks

This default path is specific to services that implement Slice interfaces and TService must correspond to an I{Name}Service interface generated by the Slice compiler.

UseDispatchInformation(IDispatcherBuilder)

Adds a middleware that creates and inserts the IDispatchInformationFeature feature in all requests.

public static IDispatcherBuilder UseDispatchInformation(this IDispatcherBuilder builder)

Parameters

builder IDispatcherBuilder

The builder being configured.

Returns

IDispatcherBuilder

The builder.

UseFeature<TFeature>(IDispatcherBuilder, TFeature)

Adds a middleware that sets a feature in all requests.

public static IDispatcherBuilder UseFeature<TFeature>(this IDispatcherBuilder builder, TFeature feature)

Parameters

builder IDispatcherBuilder

The builder being configured.

feature TFeature

The value of the feature to set in all requests.

Returns

IDispatcherBuilder

The builder.

Type Parameters

TFeature

The type of the feature.