UserManager<TUser>.AddToRoleAsync(TUser, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Add the specified user
to the named role.
public:
virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Identity::IdentityResult ^> ^ AddToRoleAsync(TUser user, System::String ^ role);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult> AddToRoleAsync (TUser user, string role);
abstract member AddToRoleAsync : 'User * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
override this.AddToRoleAsync : 'User * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
Public Overridable Function AddToRoleAsync (user As TUser, role As String) As Task(Of IdentityResult)
Parameters
- user
- TUser
The user to add to the named role.
- role
- String
The name of the role to add the user to.
Returns
The Task that represents the asynchronous operation, containing the IdentityResult of the operation.