open changes
This commit is contained in:
26
wishlist/Pages/BlogPost/Details.razor.cs
Normal file
26
wishlist/Pages/BlogPost/Details.razor.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using global::Wishlist.Models;
|
||||
using global::Wishlist.Services;
|
||||
|
||||
namespace Wishlist.Pages.BlogPost
|
||||
{
|
||||
public partial class Details
|
||||
{
|
||||
[Parameter]
|
||||
public int id { get; set; }
|
||||
|
||||
private BlogPostViewModel? blogPost;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (blogPost == null)
|
||||
{
|
||||
var result = await BlogPostService.GetbyId(id);
|
||||
if (result != null)
|
||||
blogPost = Mapper.Map<Models.BlogPost, BlogPostViewModel>(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user