IdentityServiceCollectionExtensions.AddIdentity 方法

定义

重载

AddIdentity<TUser,TRole>(IServiceCollection)

为指定的用户和角色类型添加默认标识系统配置。

AddIdentity<TUser,TRole>(IServiceCollection, Action<IdentityOptions>)
AddIdentity<TUser,TRole>(IServiceCollection, Action<IdentityOptions>)

为指定的用户和角色类型添加和配置标识系统。

AddIdentity<TUser,TRole>(IServiceCollection)

Source:
IdentityServiceCollectionExtensions.cs
Source:
IdentityServiceCollectionExtensions.cs
Source:
IdentityServiceCollectionExtensions.cs

为指定的用户和角色类型添加默认标识系统配置。

public static Microsoft.AspNetCore.Identity.IdentityBuilder AddIdentity<TUser,TRole> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TUser : class where TRole : class;
static member AddIdentity : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.AspNetCore.Identity.IdentityBuilder (requires 'User : null and 'Role : null)
<Extension()>
Public Function AddIdentity(Of TUser As Class, TRole As Class) (services As IServiceCollection) As IdentityBuilder

类型参数

TUser

表示系统中用户的类型。

TRole

表示系统中角色的类型。

参数

services
IServiceCollection

应用程序中可用的服务。

返回

用于 IdentityBuilder 创建和配置标识系统的 。

适用于

AddIdentity<TUser,TRole>(IServiceCollection, Action<IdentityOptions>)

public static Microsoft.AspNetCore.Identity.IdentityBuilder AddIdentity<TUser,TRole> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Builder.IdentityOptions> setupAction) where TUser : class where TRole : class;
static member AddIdentity : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Builder.IdentityOptions> -> Microsoft.AspNetCore.Identity.IdentityBuilder (requires 'User : null and 'Role : null)
<Extension()>
Public Function AddIdentity(Of TUser As Class, TRole As Class) (services As IServiceCollection, setupAction As Action(Of IdentityOptions)) As IdentityBuilder

类型参数

TUser
TRole

参数

setupAction
Action<IdentityOptions>

返回

适用于

AddIdentity<TUser,TRole>(IServiceCollection, Action<IdentityOptions>)

Source:
IdentityServiceCollectionExtensions.cs
Source:
IdentityServiceCollectionExtensions.cs
Source:
IdentityServiceCollectionExtensions.cs

为指定的用户和角色类型添加和配置标识系统。

public static Microsoft.AspNetCore.Identity.IdentityBuilder AddIdentity<TUser,TRole> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Identity.IdentityOptions> setupAction) where TUser : class where TRole : class;
static member AddIdentity : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Identity.IdentityOptions> -> Microsoft.AspNetCore.Identity.IdentityBuilder (requires 'User : null and 'Role : null)
<Extension()>
Public Function AddIdentity(Of TUser As Class, TRole As Class) (services As IServiceCollection, setupAction As Action(Of IdentityOptions)) As IdentityBuilder

类型参数

TUser

表示系统中用户的类型。

TRole

表示系统中角色的类型。

参数

services
IServiceCollection

应用程序中可用的服务。

setupAction
Action<IdentityOptions>

用于配置 的操作 IdentityOptions

返回

用于 IdentityBuilder 创建和配置标识系统的 。

适用于