Browse Source
Merge pull request #14188 from abpframework/berkan/extensible-cms-kit
CmsKit-Blogs: mark `OnGet` method as `virtual`
pull/14189/head
Enis Necipoglu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
3 deletions
-
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml.cs
|
|
|
@ -27,11 +27,11 @@ public class IndexModel : CmsKitPublicPageModelBase |
|
|
|
[BindProperty(SupportsGet = true)] |
|
|
|
public Guid? TagId { get; set; } |
|
|
|
|
|
|
|
public PagedResultDto<BlogPostPublicDto> Blogs { get; private set; } |
|
|
|
public PagedResultDto<BlogPostPublicDto> Blogs { get; protected set; } |
|
|
|
|
|
|
|
public PagerModel PagerModel => new PagerModel(Blogs.TotalCount, Blogs.Items.Count, CurrentPage, PageSize, Request.Path.ToString()); |
|
|
|
|
|
|
|
public CmsUserDto SelectedAuthor { get; set; } |
|
|
|
public CmsUserDto SelectedAuthor { get; protected set; } |
|
|
|
|
|
|
|
protected IBlogPostPublicAppService BlogPostPublicAppService { get; } |
|
|
|
|
|
|
|
@ -40,7 +40,7 @@ public class IndexModel : CmsKitPublicPageModelBase |
|
|
|
BlogPostPublicAppService = blogPostPublicAppService; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task OnGetAsync() |
|
|
|
public virtual async Task<IActionResult> OnGetAsync() |
|
|
|
{ |
|
|
|
Blogs = await BlogPostPublicAppService.GetListAsync( |
|
|
|
BlogSlug, |
|
|
|
@ -56,5 +56,7 @@ public class IndexModel : CmsKitPublicPageModelBase |
|
|
|
{ |
|
|
|
SelectedAuthor = await BlogPostPublicAppService.GetAuthorHasBlogPostAsync(AuthorId.Value); |
|
|
|
} |
|
|
|
|
|
|
|
return Page(); |
|
|
|
} |
|
|
|
} |
|
|
|
|