continued to work on ThreadPage.razor

This commit is contained in:
limited_dev 2023-01-25 23:45:36 +01:00
parent 585440d10f
commit 4b1f234f2a
10 changed files with 327 additions and 17 deletions

View file

@ -23,7 +23,12 @@ public static class PostsRepository
public static async Task<PostData> getPostByIdAsync(int postId)
{
await using var db = new AppDBContext();
return await db.Posts.FirstOrDefaultAsync(post => post.PostID == postId);
return await db.Posts
.Where(post => post.PostID == postId)
.Include(post => post.Image)
.Include(post => post.Comments)
.FirstOrDefaultAsync();
//return await db.Posts.FirstOrDefaultAsync(post => post.PostID == postId);
}
public static async Task<int> createPostAsync(PostData postToCreate)