共用方式為


UserManager<TUser>.RemoveFromRolesAsync 方法

定義

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

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

參數

user
TUser

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

roles
IEnumerable<String>

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

傳回

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

適用於