Class ServiceCollectionExtensions
- Namespace
- BytLabs.Application
- Assembly
- BytLabs.Application.dll
Provides extension methods for IServiceCollection to configure application services.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
- Inherited Members
Methods
AddCQS(IServiceCollection, Assembly[], Action<MediatRServiceConfiguration>?)
Configures CQRS infrastructure with MediatR, AutoMapper, and validation pipeline.
public static IServiceCollection AddCQS(this IServiceCollection services, Assembly[] assemblies, Action<MediatRServiceConfiguration>? options = null)
Parameters
services
IServiceCollectionThe service collection to configure
assemblies
Assembly[]Assemblies to scan for handlers and validators
options
Action<MediatRServiceConfiguration>Optional MediatR configuration options
Returns
- IServiceCollection
The configured service collection
AddUserContextProviders(IServiceCollection)
Configures user context resolution services.
public static UserContextBuilder AddUserContextProviders(this IServiceCollection services)
Parameters
services
IServiceCollectionThe service collection to configure
Returns
- UserContextBuilder
A builder for further user context configuration
Remarks
Enables user identification through multiple sources by registering necessary providers and accessors in the dependency injection container.