共用方式為


UserManager<TUser>.RemoveFromRoleAsync(TUser, String) 方法

定義

從具名角色中移除指定的 user

public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Identity::IdentityResult ^> ^ RemoveFromRoleAsync(TUser user, System::String ^ role);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult> RemoveFromRoleAsync (TUser user, string role);
abstract member RemoveFromRoleAsync : 'User * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
override this.RemoveFromRoleAsync : 'User * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
Public Overridable Function RemoveFromRoleAsync (user As TUser, role As String) As Task(Of IdentityResult)

參數

user
TUser

要從具名角色中移除的使用者。

role
String

要從中移除使用者的角色名稱。

傳回

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

適用於