@page "/post/{BlogPostId}"
@inject IBlogApi _api
@inject NavigationManager _navman
@if (BlogPost != null)
{
@BlogPost.Title
@BlogPost.Title
@((MarkupString)BlogPost.Text)
}
@code {
[Parameter]
public string BlogPostId { get; set; }
public BlogPost? BlogPost { get; set; }
protected async override Task OnParametersSetAsync()
{
BlogPost = await _api.GetBlogPostAsync(BlogPostId);
await base.OnParametersSetAsync();
}
}