feat: started working on replys in comments, changes IDs to GETs
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
5ee623b295
commit
396edeefde
9 changed files with 207 additions and 11 deletions
|
@ -31,6 +31,19 @@ public static class CommentsRepository
|
|||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public static async Task<CommentData> getCommentByGETAsync(string board, int get)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
return await db.Comments
|
||||
.Where(comment => comment.GET == get)
|
||||
.Where(comment => comment.Board == board)
|
||||
.Include(comment => comment.Image)
|
||||
.Include(comment => comment.Post)
|
||||
.Include(comment => comment.User)
|
||||
.Include(comment => comment.Report)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
/*public static async Task<PostData> getPostByIdAsync(int postId)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
|
|
|
@ -32,6 +32,19 @@ public static class PostsRepository
|
|||
.FirstOrDefaultAsync();
|
||||
//return await db.Posts.FirstOrDefaultAsync(post => post.PostID == postId);
|
||||
}
|
||||
|
||||
public static async Task<PostData> getPostByGETAsync(string board, int get)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
return await db.Posts
|
||||
.Where(post => post.GET == get)
|
||||
.Where(post => post.Board == board)
|
||||
.Include(post => post.Image)
|
||||
.Include(post => post.Comments)
|
||||
.Include(post => post.User)
|
||||
.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