|
|
|
@ -1,7 +1,9 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; |
|
|
|
using Volo.Abp.Domain.Entities; |
|
|
|
using Volo.Blogging.Blogs; |
|
|
|
using Volo.Blogging.Blogs.Dtos; |
|
|
|
using Volo.Blogging.Pages.Blogs.Shared.Helpers; |
|
|
|
@ -43,11 +45,13 @@ namespace Volo.Blogging.Pages.Blog.Posts |
|
|
|
return NotFound(); |
|
|
|
} |
|
|
|
|
|
|
|
Blog = await _blogAppService.GetByShortNameAsync(BlogShortName); |
|
|
|
|
|
|
|
if (Blog == null) |
|
|
|
try |
|
|
|
{ |
|
|
|
return RedirectToPage("/Blogs/Index"); |
|
|
|
Blog = await _blogAppService.GetByShortNameAsync(BlogShortName); |
|
|
|
} |
|
|
|
catch (EntityNotFoundException) |
|
|
|
{ |
|
|
|
return RedirectToPage("/Blogs/Index"); |
|
|
|
} |
|
|
|
|
|
|
|
Posts = (await _postAppService.GetListByBlogIdAndTagNameAsync(Blog.Id, TagName)).Items; |
|
|
|
|