Skip to content

IServiceProviderAccessor interface

namespace: Serenity   assembly: Serenity.Net.Core

Provides access to the service provider that should be used to resolve or activate services on demand, such as request handlers and behaviors.

public interface IServiceProviderAccessor

Members

name description
ServiceProvider { get; } Gets the service provider to use.

Remarks

In web applications the returned provider is the current request's scoped provider when available, falling back to the root provider otherwise. Resolving through this abstraction instead of capturing an IServiceProvider in a singleton avoids the captive dependency problem for services that may be registered as scoped.

See Also