IdentityServiceCollectionExtensions Class¶
Contains extension methods to Microsoft.Extensions.DependencyInjection.IServiceCollection
for configuring identity services.
- Namespace
Microsoft.Extensions.DependencyInjection
- Assemblies
- Microsoft.AspNetCore.Identity
Syntax¶
public class IdentityServiceCollectionExtensions
-
class
Microsoft.Extensions.DependencyInjection.
IdentityServiceCollectionExtensions
Methods¶
-
AddIdentity<TUser, TRole>
(Microsoft.Extensions.DependencyInjection.IServiceCollection)¶ Adds the default identity system configuration for the specified User and Role types.
Arguments: services (Microsoft.Extensions.DependencyInjection.IServiceCollection) – The services available in the application. Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: An Microsoft.AspNetCore.Identity.IdentityBuilder
for creating and configuring the identity system.public static IdentityBuilder AddIdentity<TUser, TRole>(this IServiceCollection services)where TUser : class where TRole : class
-
AddIdentity<TUser, TRole>
(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Action<Microsoft.AspNetCore.Builder.IdentityOptions>) Adds and configures the identity system for the specified User and Role types.
Arguments: - services (Microsoft.Extensions.DependencyInjection.IServiceCollection) – The services available in the application.
- setupAction (System.Action<Microsoft.AspNetCore.Builder.IdentityOptions>) – An action to configure the
Microsoft.AspNetCore.Builder.IdentityOptions
.
Return type: Returns: An
Microsoft.AspNetCore.Identity.IdentityBuilder
for creating and configuring the identity system.public static IdentityBuilder AddIdentity<TUser, TRole>(this IServiceCollection services, Action<IdentityOptions> setupAction)where TUser : class where TRole : class
-