continued to work on ThreadPage.razor
This commit is contained in:
parent
585440d10f
commit
4b1f234f2a
10 changed files with 327 additions and 17 deletions
|
@ -37,4 +37,7 @@ public class CommentData
|
|||
[Required]
|
||||
public string Board { get; set; }
|
||||
|
||||
[Required]
|
||||
public long CreatedAt { get; set; }
|
||||
|
||||
}
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue