public async Task SetRoleAsync(UserDto model) { var user = await _quizDbContext.Users.FindAsync(model.Id); if (user != null) { await _validator.ValidateAsync(model); _quizDbContext.Users.Update(model.AdaptToUser()); await _userManager.AddToRoleAsync(user, model.Role); await _quizDbContext.SaveChangesAsync(); } }