Class AutofacServiceProviderFactory
A factory for creating a
Inheritance
System.Object
AutofacServiceProviderFactory
Namespace: Autofac.Extensions.DependencyInjection
Assembly: Volo.Abp.Autofac.dll
Syntax
public class AutofacServiceProviderFactory : IServiceProviderFactory<ContainerBuilder>
Constructors
AutofacServiceProviderFactory(Action<ContainerBuilder>)
Initializes a new instance of the AutofacServiceProviderFactory class.
Declaration
public AutofacServiceProviderFactory(Action<ContainerBuilder> configurationAction = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<ContainerBuilder> | configurationAction | Action on a |
Methods
CreateBuilder(IServiceCollection)
Creates a container builder from an Microsoft.Extensions.DependencyInjection.IServiceCollection.
Declaration
public ContainerBuilder CreateBuilder(IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The collection of services |
Returns
| Type | Description |
|---|---|
| ContainerBuilder | A container builder that can be used to create an System.IServiceProvider. |
CreateServiceProvider(ContainerBuilder)
Creates an System.IServiceProvider from the container builder.
Declaration
public IServiceProvider CreateServiceProvider(ContainerBuilder containerBuilder)
Parameters
| Type | Name | Description |
|---|---|---|
| ContainerBuilder | containerBuilder | The container builder |
Returns
| Type | Description |
|---|---|
| IServiceProvider | An System.IServiceProvider |