Class Extensions
Provides extension methods for working with IServiceCollection and dependency injection.
Inherited Members
Namespace: Innovt.Core.CrossCutting.Ioc
Assembly: Innovt.Core.dll
Syntax
public static class Extensions
Remarks
This static class contains extension methods that enhance the functionality of the IServiceCollection interface, enabling easier registration of services and modules.
Methods
| Edit this page View SourceAddModule(IServiceCollection, IocModule)
Adds services from the specified module to the services collection.
Declaration
public static void AddModule(this IServiceCollection services, IocModule module)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The IServiceCollection to which services should be added. |
| IocModule | module | The IocModule containing services to be added. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
AddModule(IServiceCollection, Assembly)
Adds services defined in modules from the specified assembly to the services collection.
Declaration
public static void AddModule(this IServiceCollection services, Assembly assembly)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The IServiceCollection to which services should be added. |
| Assembly | assembly | The assembly containing modules to be added. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |