Table of Contents

Class AbpLazyServiceProvider

Namespace
Volo.Abp.DependencyInjection
Assembly
Volo.Abp.Core.dll

This class is equivalent of the TransientCachedServiceProvider. Use TransientCachedServiceProvider instead of this class, for new projects.

[ExposeServices(new Type[] { typeof(IAbpLazyServiceProvider) })]
public class AbpLazyServiceProvider : CachedServiceProviderBase, IAbpLazyServiceProvider, ICachedServiceProviderBase, IKeyedServiceProvider, IServiceProvider, ITransientDependency
Inheritance
AbpLazyServiceProvider
Implements
Inherited Members
Extension Methods

Constructors

AbpLazyServiceProvider(IServiceProvider)

public AbpLazyServiceProvider(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

Methods

LazyGetRequiredService(Type)

This method is equivalent of the GetRequiredService method. It does exists for backward compatibility.

public virtual object LazyGetRequiredService(Type serviceType)

Parameters

serviceType Type

Returns

object

LazyGetRequiredService<T>()

This method is equivalent of the GetRequiredService method. It does exists for backward compatibility.

public virtual T LazyGetRequiredService<T>()

Returns

T

Type Parameters

T

LazyGetService(Type)

This method is equivalent of the GetService method. It does exists for backward compatibility.

public virtual object? LazyGetService(Type serviceType)

Parameters

serviceType Type

Returns

object

LazyGetService(Type, Func<IServiceProvider, object>)

This method is equivalent of the GetService(Type, Func<IServiceProvider, object>) method. It does exists for backward compatibility.

public virtual object LazyGetService(Type serviceType, Func<IServiceProvider, object> factory)

Parameters

serviceType Type
factory Func<IServiceProvider, object>

Returns

object

LazyGetService(Type, object)

This method is equivalent of the GetService(Type, object) method. It does exists for backward compatibility.

public virtual object LazyGetService(Type serviceType, object defaultValue)

Parameters

serviceType Type
defaultValue object

Returns

object

LazyGetService<T>()

This method is equivalent of the GetService method. It does exists for backward compatibility.

public virtual T? LazyGetService<T>()

Returns

T

Type Parameters

T

LazyGetService<T>(Func<IServiceProvider, object>)

This method is equivalent of the GetService<T>(Func<IServiceProvider, object>) method. It does exists for backward compatibility.

public virtual T LazyGetService<T>(Func<IServiceProvider, object> factory)

Parameters

factory Func<IServiceProvider, object>

Returns

T

Type Parameters

T

LazyGetService<T>(T)

This method is equivalent of the GetService<T>(T) method. It does exists for backward compatibility.

public virtual T LazyGetService<T>(T defaultValue)

Parameters

defaultValue T

Returns

T

Type Parameters

T