Table of Contents

Class MessageMappingServiceCollectionExtensions

Namespace
Microsoft.Extensions.DependencyInjection
Assembly
Excalibur.Dispatch.dll

Extension methods for configuring message mapping via dependency injection.

public static class MessageMappingServiceCollectionExtensions
Inheritance
MessageMappingServiceCollectionExtensions
Inherited Members

Methods

AddMessageMapper(IDispatchBuilder, IMessageMapper)

Registers a custom message mapper instance with the dispatch builder.

public static IDispatchBuilder AddMessageMapper(this IDispatchBuilder builder, IMessageMapper mapper)

Parameters

builder IDispatchBuilder

The dispatch builder.

mapper IMessageMapper

The mapper instance to register.

Returns

IDispatchBuilder

The dispatch builder for fluent configuration.

AddMessageMapper<TMapper>(IDispatchBuilder)

Registers a custom message mapper with the dispatch builder.

public static IDispatchBuilder AddMessageMapper<TMapper>(this IDispatchBuilder builder) where TMapper : class, IMessageMapper

Parameters

builder IDispatchBuilder

The dispatch builder.

Returns

IDispatchBuilder

The dispatch builder for fluent configuration.

Type Parameters

TMapper

The type of mapper to register.

AddMessageMapping(IServiceCollection)

Adds message mapping services to the service collection.

public static IServiceCollection AddMessageMapping(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection.

Returns

IServiceCollection

The service collection for chaining.

AddMessageMapping(IServiceCollection, Action<IMessageMappingBuilder>)

Adds message mapping services with configuration to the service collection.

public static IServiceCollection AddMessageMapping(this IServiceCollection services, Action<IMessageMappingBuilder> configure)

Parameters

services IServiceCollection

The service collection.

configure Action<IMessageMappingBuilder>

Action to configure message mapping.

Returns

IServiceCollection

The service collection for chaining.

UseDefaultMessageMappers(IDispatchBuilder)

Adds default message mappers (RabbitMQ↔Kafka, etc.) to the dispatch builder.

public static IDispatchBuilder UseDefaultMessageMappers(this IDispatchBuilder builder)

Parameters

builder IDispatchBuilder

The dispatch builder.

Returns

IDispatchBuilder

The dispatch builder for fluent configuration.

WithMessageMapping(IDispatchBuilder, Action<IMessageMappingBuilder>)

Configures message mapping for the dispatch builder.

public static IDispatchBuilder WithMessageMapping(this IDispatchBuilder builder, Action<IMessageMappingBuilder> configure)

Parameters

builder IDispatchBuilder

The dispatch builder.

configure Action<IMessageMappingBuilder>

Action to configure message mapping.

Returns

IDispatchBuilder

The dispatch builder for fluent configuration.