open changes
This commit is contained in:
20
wishlist/Pages/BlogPost/Index.razor.cs
Normal file
20
wishlist/Pages/BlogPost/Index.razor.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using global::Wishlist.Models;
|
||||
using global::Wishlist.Services;
|
||||
|
||||
namespace Wishlist.Pages.BlogPost
|
||||
{
|
||||
public partial class Index
|
||||
{
|
||||
private IEnumerable<BlogPostViewModel>? blogPosts;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (blogPosts == null)
|
||||
{
|
||||
var result = await BlogPostService.GetAllAsync();
|
||||
blogPosts = Mapper.Map<IEnumerable<Models.BlogPost>, IEnumerable<BlogPostViewModel>>(result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user