Class AutofacServiceProvider
Autofac implementation of the ASP.NET Core
Inheritance
Implements
Namespace: Autofac.Extensions.DependencyInjection
Assembly: Volo.Abp.Autofac.dll
Syntax
public class AutofacServiceProvider : IServiceProvider, ISupportRequiredService, IDisposable
Constructors
AutofacServiceProvider(ILifetimeScope)
Initializes a new instance of the AutofacServiceProvider class.
Declaration
public AutofacServiceProvider(ILifetimeScope lifetimeScope)
Parameters
| Type | Name | Description |
|---|---|---|
| ILifetimeScope | lifetimeScope | The lifetime scope from which services will be resolved. |
Properties
LifetimeScope
Gets the underlying instance of
Declaration
public ILifetimeScope LifetimeScope { get; }
Property Value
| Type | Description |
|---|---|
| ILifetimeScope |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
GetRequiredService(Type)
Gets service of type serviceType from the
AutofacServiceProvider and requires it be present.
Declaration
public object GetRequiredService(Type serviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | serviceType | An object that specifies the type of service object to get. |
Returns
| Type | Description |
|---|---|
| System.Object | A service object of type |
GetService(Type)
Gets the service object of the specified type.
Declaration
public object GetService(Type serviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | serviceType | An object that specifies the type of service object to get. |
Returns
| Type | Description |
|---|---|
| System.Object | A service object of type |