Skip to content

HttpContextServiceProviderAccessor class

namespace: Serenity   assembly: Serenity.Net.Web

An IServiceProviderAccessor that uses the current HTTP request's scoped service provider when available, falling back to the root provider otherwise.

public class HttpContextServiceProviderAccessor : IServiceProviderAccessor
parameter description
serviceProvider Root service provider used when there is no active HTTP request.
httpContextAccessor HTTP context accessor.

Public Members

name description
HttpContextServiceProviderAccessor(…) An IServiceProviderAccessor that uses the current HTTP request's scoped service provider when available, falling back to the root provider otherwise.
ServiceProvider { get; }

Exceptions

exception condition
ArgumentNullException serviceProvider is null.

Remarks

Initializes a new instance of the class.

See Also