Beispiel #1
0
 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();
 }
Beispiel #2
0
 protected void IncreasePage()
 {
     PageNumber = ++PageNumber;
     if (PageNumber > PageCount)
     {
         Posts = Posts;
     }
     else
     {
         //Posts = await CommunityService.GetAllPosts();
         Posts = AllPosts.Skip(PageNumber * PageSize).OrderByDescending(d => d.Time).Take(PageSize);
         StateHasChanged();
         NavigationManager.NavigateTo($"/posts/{CommunityId}");
     }
 }
Beispiel #3
0
        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);
        }