Show / Hide Table of Contents

Class AutofacServiceProvider

Autofac implementation of the ASP.NET Core .

Inheritance
System.Object
AutofacServiceProvider
Implements
ISupportRequiredService
IDisposable
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 serviceType.

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 serviceType; or null if there is no service object of type serviceType.

Implements

ISupportRequiredService
IDisposable

Extension Methods

AbpObjectExtensions.As<T>(Object)
AbpObjectExtensions.To<T>(Object)
AbpObjectExtensions.IsIn<T>(T, T[])
AbpObjectExtensions.If<T>(T, Boolean, Func<T, T>)
AbpObjectExtensions.If<T>(T, Boolean, Action<T>)
LockExtensions.Locking(Object, Action)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<TResult>(Object, Func<TResult>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
Back to top Powered by Volosoft