From 83f63ad729d585d597bdcf0afc05b7d56344223e Mon Sep 17 00:00:00 2001 From: transtrike Date: Sun, 17 Jan 2021 13:38:24 +0200 Subject: Lang&Tech layers now return id on Create --- src/DevHive.Data/Repositories/PostRepository.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/DevHive.Data/Repositories') diff --git a/src/DevHive.Data/Repositories/PostRepository.cs b/src/DevHive.Data/Repositories/PostRepository.cs index 3be14e3..c5e8569 100644 --- a/src/DevHive.Data/Repositories/PostRepository.cs +++ b/src/DevHive.Data/Repositories/PostRepository.cs @@ -43,6 +43,13 @@ namespace DevHive.Data.Repositories .FindAsync(id); } + public async Task GetPostByIssuerAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated) + { + return await this._context.Posts + .FirstOrDefaultAsync(p => p.IssuerId == issuerId && + p.TimeCreated == timeCreated); + } + public async Task GetCommentByIdAsync(Guid id) { return await this._context @@ -50,6 +57,13 @@ namespace DevHive.Data.Repositories .FindAsync(id); } + public async Task GetCommentByIssuerAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated) + { + return await this._context.Comments + .FirstOrDefaultAsync(p => p.IssuerId == issuerId && + p.TimeCreated == timeCreated); + } + //Update public async Task EditAsync(Post newPost) { -- cgit v1.2.3