共用方式為


AspNetRoleManager<TRole> 建構函式

定義

建構 RoleManager<TRole> 的新執行個體。

public:
 AspNetRoleManager(Microsoft::AspNetCore::Identity::IRoleStore<TRole> ^ store, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Identity::IRoleValidator<TRole> ^> ^ roleValidators, Microsoft::AspNetCore::Identity::ILookupNormalizer ^ keyNormalizer, Microsoft::AspNetCore::Identity::IdentityErrorDescriber ^ errors, Microsoft::Extensions::Logging::ILogger<Microsoft::AspNetCore::Identity::RoleManager<TRole> ^> ^ logger, Microsoft::AspNetCore::Http::IHttpContextAccessor ^ contextAccessor);
public AspNetRoleManager (Microsoft.AspNetCore.Identity.IRoleStore<TRole> store, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Identity.IRoleValidator<TRole>> roleValidators, Microsoft.AspNetCore.Identity.ILookupNormalizer keyNormalizer, Microsoft.AspNetCore.Identity.IdentityErrorDescriber errors, Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Identity.RoleManager<TRole>> logger, Microsoft.AspNetCore.Http.IHttpContextAccessor contextAccessor);
new Microsoft.AspNetCore.Identity.AspNetRoleManager<'Role (requires 'Role : null)> : Microsoft.AspNetCore.Identity.IRoleStore<'Role (requires 'Role : null)> * seq<Microsoft.AspNetCore.Identity.IRoleValidator<'Role>> * Microsoft.AspNetCore.Identity.ILookupNormalizer * Microsoft.AspNetCore.Identity.IdentityErrorDescriber * Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Identity.RoleManager<'Role>> * Microsoft.AspNetCore.Http.IHttpContextAccessor -> Microsoft.AspNetCore.Identity.AspNetRoleManager<'Role (requires 'Role : null)>
Public Sub New (store As IRoleStore(Of TRole), roleValidators As IEnumerable(Of IRoleValidator(Of TRole)), keyNormalizer As ILookupNormalizer, errors As IdentityErrorDescriber, logger As ILogger(Of RoleManager(Of TRole)), contextAccessor As IHttpContextAccessor)

參數

store
IRoleStore<TRole>

管理員將會運作的持續性存放區。

roleValidators
IEnumerable<IRoleValidator<TRole>>

角色的驗證程式集合。

keyNormalizer
ILookupNormalizer

將角色名稱正規化為索引鍵時要使用的正規化程式。

errors
IdentityErrorDescriber

IdentityErrorDescriber用來提供者錯誤訊息的 。

logger
ILogger<RoleManager<TRole>>

用來記錄訊息、警告和錯誤的記錄器。

contextAccessor
IHttpContextAccessor

用來存取 的 HttpContext 存取子。

適用於