|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
|
|
|
|
|
using Volo.Blogging.Blogs;
|
|
|
|
|
|
|
|
|
|
@ -8,19 +9,21 @@ namespace Volo.Blogging.Pages.Blog
|
|
|
|
|
{
|
|
|
|
|
public class IndexModel : AbpPageModel
|
|
|
|
|
{
|
|
|
|
|
public List<BlogDto> Blogs { get; private set; }
|
|
|
|
|
private readonly IBlogAppService _blogAppService;
|
|
|
|
|
|
|
|
|
|
public IndexModel()
|
|
|
|
|
public IReadOnlyList<BlogDto> Blogs { get; private set; }
|
|
|
|
|
|
|
|
|
|
public IndexModel(IBlogAppService blogAppService)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
_blogAppService = blogAppService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task OnGet()
|
|
|
|
|
public async Task<IActionResult> OnGet()
|
|
|
|
|
{
|
|
|
|
|
Blogs = new List<BlogDto>
|
|
|
|
|
{
|
|
|
|
|
new BlogDto {Id = Guid.NewGuid(), Name = "abp", ShortName = "abp", Description = "a b p"}
|
|
|
|
|
};
|
|
|
|
|
var result = await _blogAppService.GetListAsync();
|
|
|
|
|
|
|
|
|
|
Blogs = result.Items;
|
|
|
|
|
return Page();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|