refactor: get author using BlogService

This commit is contained in:
Oliver Booth 2023-08-08 11:34:41 +01:00
parent 3c62a42d32
commit 6b18b36b96
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@
@foreach (BlogPost post in BlogService.AllPosts) @foreach (BlogPost post in BlogService.AllPosts)
{ {
Author? author = Model.GetAuthor(post); BlogService.TryGetAuthor(post, out Author? author);
DateTimeOffset published = post.Published; DateTimeOffset published = post.Published;
DateTimeOffset timestamp = post.Updated ?? published; DateTimeOffset timestamp = post.Updated ?? published;
bool isUpdated = post.Updated.HasValue; bool isUpdated = post.Updated.HasValue;