Table of Contents

Class ApplicationServiceCollectionExtensions

Namespace
Signal.Application
Assembly
Signal.Application.dll

DI registration of the application layer.

public static class ApplicationServiceCollectionExtensions
Inheritance
ApplicationServiceCollectionExtensions
Inherited Members

Methods

AddSignalApplication(IServiceCollection)

Registers the application layer: options validation, the message pipeline with its built-in middleware, domain event dispatching and the command system (including the help command). Every service is registered with TryAdd, so implementations registered earlier take precedence.

public static IServiceCollection AddSignalApplication(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection.

Returns

IServiceCollection

services for chaining.

Remarks

Ports (IMessageSender, IReactionService, …) are not registered here; they come from the infrastructure layer or from your own implementations. Usually called through AddSignal().

GetOrAddSingletonInstance<T>(IServiceCollection)

Returns the singleton instance registered for T, registering a new one if needed. Used for registration-time state such as CommandCatalog and MiddlewareRegistry.

public static T GetOrAddSingletonInstance<T>(this IServiceCollection services) where T : class, new()

Parameters

services IServiceCollection

The service collection.

Returns

T

The shared instance.

Type Parameters

T

The service type, registered as an instance.