MediaAttachmentsTests init

This commit is contained in:
Artemy
2025-06-22 15:37:20 +07:00
parent 64a06c0d1c
commit 4956a175c5
4 changed files with 163 additions and 2 deletions
@@ -26,9 +26,13 @@ public class MediaAttachmentsRepository : IMediaAttachmentsRepository
.ToListOrThrowIfEmpty(new NotFoundException("No media attachments found."));
}
public Task<List<MediaAttachments>> GetAllByMessageId(Guid messageId)
public async Task<List<MediaAttachments>> GetAllByMessageId(Guid messageId)
{
throw new NotImplementedException();
return await _context.MediaAttachments
.AsNoTracking()
.Include(ma => ma.Message)
.Where(m => m.MessageId == messageId)
.ToListOrThrowIfEmpty(new NotFoundByKeyException<Guid>(messageId, "No media attachments found by given message Id"));
}
public Task AddAsync(MediaAttachments mediaAttachments)