Beispiel #1
0
        public async Task RegisterUserRoles(RegisterUserRole userRole)
        {
            var result = await _httpClient.PostAsJsonAsync("api/auth/registeruserroles", userRole);

            if (result.StatusCode == System.Net.HttpStatusCode.BadRequest)
            {
                throw new Exception(await result.Content.ReadAsStringAsync());
            }
            result.EnsureSuccessStatusCode();
        }
Beispiel #2
0
        public async Task <IActionResult> RegisterUserRoles(RegisterUserRole userRole)
        {
            var appUserRole = new AppUserRole()
            {
                RoleId = userRole.RoleId.ToString(),
                UserId = userRole.UserId.ToString()
            };

            _db.UserRoles.Add(appUserRole);
            await _db.SaveChangesAsync();

            return(Ok());
        }
Beispiel #3
0
        public async Task RegisterUserRoles(RegisterUserRole registerParameters)
        {
            await api.RegisterUserRoles(registerParameters);

            //NotifyAuthenticationStateChanged(GetAuthenticationStateAsync());
        }