共用方式為


RoleManager<TRole>.SetRoleNameAsync(TRole, String) 方法

定義

設定指定 role 的名稱。

public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Identity::IdentityResult ^> ^ SetRoleNameAsync(TRole role, System::String ^ name);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult> SetRoleNameAsync (TRole role, string name);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult> SetRoleNameAsync (TRole role, string? name);
abstract member SetRoleNameAsync : 'Role * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
override this.SetRoleNameAsync : 'Role * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
Public Overridable Function SetRoleNameAsync (role As TRole, name As String) As Task(Of IdentityResult)

參數

role
TRole

應該設定其名稱的角色。

name
String

要設定的名稱。

傳回

Task 表示非同步作業,其中包含 IdentityResult 作業的 。

適用於