Table of Contents

Class SingleMessageArgumentResolver

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

Resolves the parameters declared with a type that is compatible with the type of the message being published.

public class SingleMessageArgumentResolver : ISingleMessageArgumentResolver, IMessageArgumentResolver, IArgumentResolver
Inheritance
SingleMessageArgumentResolver
Implements
Inherited Members

Constructors

SingleMessageArgumentResolver()

public SingleMessageArgumentResolver()

Properties

SkipInvocationIfNull

Gets a value indicating whether the subscriber invocation should be skipped if the resolved value is null.

public bool SkipInvocationIfNull { get; }

Property Value

bool

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.

GetMessageType(Type)

Returns the actual message type in the specified parameter type (e.g. TMessage) for a parameter declared as IEnumerable<TMessage>.

public Type GetMessageType(Type parameterType)

Parameters

parameterType Type

The type of the parameter to be resolved.

Returns

Type

The actual message type.

GetValue(object?, Type)

Returns the message value in a shape that is compatible with the subscribed method.

public object? GetValue(object? message, Type parameterType)

Parameters

message object

The message being published.

parameterType Type

The type of the parameter to be resolved.

Returns

object

The actual value to be forwarded to the subscribed method.