private void AddUserRole(PUser user, string roleLogicalName) { PRole role = _roleService.GetRoleByLogicalName(roleLogicalName); if (role == null) { throw new Exception(); } _userRolesService.Add(new PUserRole() { Role = role, User = user }); }
public async Task <ActionResult> Add(AddUserToRoleInputDto model) { await userRolesServices.Add(model); return(Ok()); }