public async Task <IActionResult> Get([FromQuery] int pageIndex = -1, [FromQuery] int pageSize = 5)
        {
            var posts = await _postsRepo.GetAllAsync().ToList();

            if (pageIndex < 0)
            {
                return(Ok(await _postsRepo.GetAllAsync().ToList()));
            }
            else
            {
                PaginatedItems <BlogPost> pagedPosts = await _postsRepo.GetAllPagedAsync(pageIndex, pageSize);

                bool isLastPage = false;
                if (pageIndex >= pagedPosts.TotalItems / pageSize)
                {
                    isLastPage = true;
                }
                pagedPosts.NextPage = (!isLastPage ? Url.Link(null, new { pageIndex = pageIndex + 1, pageSize = pageSize }) : null);
                return(Ok(pagedPosts));
            }
        }