public async Task <IActionResult> TestManageAsync() { string userId = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value; var userInfoViewModel = await _authManagementClient.GetUserInfo(userId); var allUsersList = await _authManagementClient.GetUsersIds(); return(View()); }
public async Task <List <BlogViewModel> > GetAllBlogs() { var allUsersList = await _authManagementClient.GetUsersIds(); var blogs = new List <BlogViewModel>(); foreach (var userId in allUsersList) { var userDetails = await _authManagementClient.GetUserInfo(userId); var userBlogs = await _blogAndPostClient.GetUserBlogs(userId); foreach (var blog in userBlogs) { blog.userName = userDetails.name; } blogs.AddRange(userBlogs); } return(blogs); }