|
|
|
@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
|
using Volo.Blogging.Blogs;
|
|
|
|
|
using Volo.Blogging.Blogs.Dtos;
|
|
|
|
|
using Volo.Blogging.Posts;
|
|
|
|
|
using Volo.Blogging.Tagging;
|
|
|
|
|
using Volo.Blogging.Tagging.Dtos;
|
|
|
|
@ -21,6 +22,8 @@ namespace Volo.Blogging.Pages.Blog.Posts
|
|
|
|
|
[BindProperty(SupportsGet = true)]
|
|
|
|
|
public string TagName { get; set; }
|
|
|
|
|
|
|
|
|
|
public BlogDto Blog { get; set; }
|
|
|
|
|
|
|
|
|
|
public IReadOnlyList<PostWithDetailsDto> Posts { get; set; }
|
|
|
|
|
|
|
|
|
|
public IReadOnlyList<TagDto> PopularTags { get; set; }
|
|
|
|
@ -34,8 +37,8 @@ namespace Volo.Blogging.Pages.Blog.Posts
|
|
|
|
|
|
|
|
|
|
public async Task OnGetAsync()
|
|
|
|
|
{
|
|
|
|
|
var blog = await _blogAppService.GetByShortNameAsync(BlogShortName);
|
|
|
|
|
Posts = (await _postAppService.GetListByBlogIdAndTagName(blog.Id, TagName)).Items;
|
|
|
|
|
Blog = await _blogAppService.GetByShortNameAsync(BlogShortName);
|
|
|
|
|
Posts = (await _postAppService.GetListByBlogIdAndTagName(Blog.Id, TagName)).Items;
|
|
|
|
|
PopularTags = (await _tagAppService.GetPopularTags(new GetPopularTagsInput {ResultCount = 10}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|