Table of Contents

Interface IMiddleware<TDep1, TDep2, TDep3>

Namespace
IceRpc.Extensions.DependencyInjection
Assembly
IceRpc.dll

Represents a middleware with 3 injected service dependencies in its DispatchAsync(IncomingRequest, TDep1, TDep2, TDep3, CancellationToken) method.

public interface IMiddleware<TDep1, TDep2, TDep3> where TDep1 : notnull where TDep2 : notnull where TDep3 : notnull

Type Parameters

TDep1

The type of the first injected dependency.

TDep2

The type of the second injected dependency.

TDep3

The type of the third injected dependency.

Remarks

This interface is implemented by a middleware that communicates with other middleware via injected services.

Methods

DispatchAsync(IncomingRequest, TDep1, TDep2, TDep3, CancellationToken)

Dispatches a request and returns a response.

ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, TDep1 dep1, TDep2 dep2, TDep3 dep3, CancellationToken cancellationToken)

Parameters

request IncomingRequest

The request being dispatched.

dep1 TDep1

The first injected dependency.

dep2 TDep2

The second injected dependency.

dep3 TDep3

The third injected dependency.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

ValueTask<OutgoingResponse>

The response.

See Also