20 lines
524 B
C#
20 lines
524 B
C#
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);
|
|
}
|
|
}
|
|
|
|
}
|
|
} |