public async void AddPostDialog_OnDialogClose() { LoadDeveloper(); AllPosts = (await CommunityService.GetAllPosts()).ToList().OrderBy(d => d.Time); PostsCount = AllPosts.Count(); PageCount = PostsCount / 9; Posts = AllPosts.Skip(PageNumber * PageSize).Take(PageSize); StateHasChanged(); }
protected async override Task OnInitializedAsync() { LoadDeveloper(); Community = await CommunityService.GetCommunity(CommunityId); AllPosts = Community.Posts.OrderByDescending(d => d.Time); Title = Community.Name + " Posts"; if (AllPosts == null || AllPosts.Count() == 0) { AllPosts = (await CommunityService.GetAllPosts()).ToList().OrderByDescending(d => d.Time); Title = "All Posts"; } PostsCount = AllPosts.Count(); PageCount = PostsCount / 9; Posts = AllPosts.Skip(PageNumber * PageSize).Take(PageSize); }
protected async override Task OnInitializedAsync() { LoadDeveloper(); Posts = await CommunityService.GetAllPosts(); }