0
malomatia created
Dears, How to create a user from the .net code and assign him specific roles ?
Thank you !
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
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.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)