diff --git a/OliverBooth/Services/BlogService.cs b/OliverBooth/Services/BlogService.cs
index 8292e0f..c15dd83 100644
--- a/OliverBooth/Services/BlogService.cs
+++ b/OliverBooth/Services/BlogService.cs
@@ -61,7 +61,25 @@ public sealed class BlogService
int moreIndex = span.IndexOf("", StringComparison.Ordinal);
trimmed = moreIndex != -1 || span.Length > 256;
string result = moreIndex != -1 ? span[..moreIndex].Trim().ToString() : post.Body.Truncate(256);
- return RenderContent(result);
+ return RenderContent(result).Trim();
+ }
+
+ ///
+ /// Attempts to find the author by ID.
+ ///
+ /// The ID of the author.
+ ///
+ /// When this method returns, contains the associated with the specified ID, if the author
+ /// is found; otherwise, .
+ ///
+ /// if the author is found; otherwise, .
+ /// is .
+ public bool TryGetAuthor(int id, [NotNullWhen(true)] out Author? author)
+ {
+ using BlogContext context = _dbContextFactory.CreateDbContext();
+ author = context.Authors.FirstOrDefault(a => a.Id == id);
+
+ return author is not null;
}
///
@@ -71,6 +89,7 @@ public sealed class BlogService
///
/// When this method returns, contains the associated with the specified blog post, if the
/// author is found; otherwise, .
+ ///
/// if the author is found; otherwise, .
/// is .
public bool TryGetAuthor(BlogPost post, [NotNullWhen(true)] out Author? author)