Table of Contents

Class ServiceCollectionExtensions

Namespace
ReflectionEventing.DependencyInjection
Assembly
ReflectionEventing.DependencyInjection.dll

Provides extension methods for the IServiceCollection interface.

public static class ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions
Inherited Members

Methods

AddEventBus(IServiceCollection, Action<EventBusBuilder>)

Adds the event bus and its related services to the specified services collection.

public static IServiceCollection AddEventBus(this IServiceCollection services, Action<EventBusBuilder> configure)

Parameters

services IServiceCollection

The IServiceCollection to add the event bus to.

configure Action<EventBusBuilder>

A delegate that configures the EventBusBuilder.

Returns

IServiceCollection

The same service collection so that multiple calls can be chained.

Remarks

This method adds a singleton service of type IConsumerTypesProvider that uses a HashedConsumerTypesProvider with the consumers from the event bus builder. It also adds a scoped service of type IEventBus that uses the EventBus class.