Table of Contents

Class CancellationTokenArgumentResolver

Namespace
Silverback.Messaging.Subscribers.ArgumentResolvers
Assembly
Silverback.Core.dll

Provides the CancellationToken to the subscribed method.

public class CancellationTokenArgumentResolver : IAdditionalArgumentResolver, IArgumentResolver
Inheritance
CancellationTokenArgumentResolver
Implements
Inherited Members

Constructors

CancellationTokenArgumentResolver()

public CancellationTokenArgumentResolver()

Methods

CanResolve(Type)

Returns a boolean value indicating whether this resolver instance can handle the parameter of the specified type.

public bool CanResolve(Type parameterType)

Parameters

parameterType Type

The type of the parameter to be resolved.

Returns

bool

A boolean value indicating whether the specified parameter type can be handled.

GetValue(Type, IServiceProvider, CancellationToken)

Returns a suitable value for the parameter of the specified type.

public object GetValue(Type parameterType, IServiceProvider serviceProvider, CancellationToken cancellationToken)

Parameters

parameterType Type

The type of the parameter to be resolved.

serviceProvider IServiceProvider

The IServiceProvider to be used to resolve the necessary services.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the subscriber method operation.

Returns

object

A value to be forwarded to the subscribed method.