Class IdentityServiceCollectionExtensions
- Namespace
- Microsoft.Extensions.DependencyInjection
- Assembly
- Stratara.Infrastructure.dll
Service-collection extensions for the session-backed identity adapters (ITenantService and ICurrentUserService).
public static class IdentityServiceCollectionExtensions
- Inheritance
-
IdentityServiceCollectionExtensions
- Inherited Members
Methods
AddIdentity(IServiceCollection)
Registers the scoped ITenantService and ICurrentUserService implementations that resolve their values from the ambient ISessionContextProvider.
public static IServiceCollection AddIdentity(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection.
Returns
- IServiceCollection
The same service collection for chaining.
Examples
The services it registers read the ambient session context, so a host that never sets one resolves them successfully and gets empty values:
services.AddSessionContext();
services.AddIdentity();