0
malomatia created
Dears, How to create a user from the .net code and assign him specific roles ?
Thank you !
1 Answer(s)
-
0
Hi,
You can use UserManager for that.
await UserManager.CreateAsync(user)
You can also add any role to user's Roles list before creating it.
user.Roles.Add(new UserRole(TenantId, user.Id, role.Id));
Thanks.