Table of Contents

Class EventBusBuilderExtensions

Namespace
ReflectionEventing.DependencyInjection
Assembly
ReflectionEventing.DependencyInjection.dll
public static class EventBusBuilderExtensions
Inheritance
EventBusBuilderExtensions
Inherited Members

Methods

AddConsumer<TConsumer>(EventBusBuilder, ServiceLifetime)

Adds a consumer to the event bus builder and IServiceCollection.

public static EventBusBuilder AddConsumer<TConsumer>(this EventBusBuilder builder, ServiceLifetime lifetime)

Parameters

builder EventBusBuilder

The event bus builder to add the consumer to.

lifetime ServiceLifetime

The service lifetime of the consumer.

Returns

EventBusBuilder

The event bus builder with the consumer added.

Type Parameters

TConsumer

The type of the consumer to add.

AddScopedConsumer(EventBusBuilder, Type)

Adds a consumer to the event bus builder and IServiceCollection.

public static EventBusBuilder AddScopedConsumer(this EventBusBuilder builder, Type consumerType)

Parameters

builder EventBusBuilder

The event bus builder to add the consumer to.

consumerType Type

The type of the consumer to add.

Returns

EventBusBuilder

The event bus builder with the consumer added.

AddScopedConsumer<TConsumer>(EventBusBuilder)

Adds a consumer to the event bus builder and IServiceCollection.

public static EventBusBuilder AddScopedConsumer<TConsumer>(this EventBusBuilder builder)

Parameters

builder EventBusBuilder

The event bus builder to add the consumer to.

Returns

EventBusBuilder

The event bus builder with the consumer added.

Type Parameters

TConsumer

The type of the consumer to add.

AddSingletonConsumer(EventBusBuilder, Type)

Adds a consumer to the event bus builder and IServiceCollection.

public static EventBusBuilder AddSingletonConsumer(this EventBusBuilder builder, Type consumerType)

Parameters

builder EventBusBuilder

The event bus builder to add the consumer to.

consumerType Type

The type of the consumer to add.

Returns

EventBusBuilder

The event bus builder with the consumer added.

AddSingletonConsumer<TConsumer>(EventBusBuilder)

Adds a consumer to the event bus builder and IServiceCollection.

public static EventBusBuilder AddSingletonConsumer<TConsumer>(this EventBusBuilder builder)

Parameters

builder EventBusBuilder

The event bus builder to add the consumer to.

Returns

EventBusBuilder

The event bus builder with the consumer added.

Type Parameters

TConsumer

The type of the consumer to add.

AddTransientConsumer(EventBusBuilder, Type)

Adds a consumer to the event bus builder and IServiceCollection.

public static EventBusBuilder AddTransientConsumer(this EventBusBuilder builder, Type consumerType)

Parameters

builder EventBusBuilder

The event bus builder to add the consumer to.

consumerType Type

The type of the consumer to add.

Returns

EventBusBuilder

The event bus builder with the consumer added.

AddTransientConsumer<TConsumer>(EventBusBuilder)

Adds a consumer to the event bus builder and IServiceCollection.

public static EventBusBuilder AddTransientConsumer<TConsumer>(this EventBusBuilder builder)

Parameters

builder EventBusBuilder

The event bus builder to add the consumer to.

Returns

EventBusBuilder

The event bus builder with the consumer added.

Type Parameters

TConsumer

The type of the consumer to add.

UseBackgroundService<TQueueBackgroundService>(EventBusBuilder)

Configures the event bus to use a custom background service for processing events.

public static EventBusBuilder UseBackgroundService<TQueueBackgroundService>(this EventBusBuilder builder) where TQueueBackgroundService : class, IHostedService

Parameters

builder EventBusBuilder

Returns

EventBusBuilder

The current instance of EventBusBuilder.

Type Parameters

TQueueBackgroundService

The type of the background service to use. This type must implement IHostedService.