MediaAttachments first init

This commit is contained in:
Artemy
2025-06-22 15:10:10 +07:00
parent b75c0d3f5a
commit 64a06c0d1c
6 changed files with 94 additions and 2 deletions
@@ -0,0 +1,58 @@
using Govor.Core.Infrastructure.Extensions;
using Govor.Core.Infrastructure.Validators;
using Govor.Core.Models;
using Govor.Core.Repositories.MediasAttachments;
using Govor.Data.Repositories.Exceptions;
using Microsoft.EntityFrameworkCore;
namespace Govor.Data.Repositories;
public class MediaAttachmentsRepository : IMediaAttachmentsRepository
{
public IObjectValidator<MediaAttachments> _validator;
public GovorDbContext _context;
public MediaAttachmentsRepository(GovorDbContext context, IObjectValidator<MediaAttachments> validator)
{
_context = context;
_validator = validator;
}
public async Task<List<MediaAttachments>> GetAllAsync()
{
return await _context.MediaAttachments
.AsNoTracking()
.Include(ma => ma.Message)
.ToListOrThrowIfEmpty(new NotFoundException("No media attachments found."));
}
public Task<List<MediaAttachments>> GetAllByMessageId(Guid messageId)
{
throw new NotImplementedException();
}
public Task AddAsync(MediaAttachments mediaAttachments)
{
throw new NotImplementedException();
}
public Task UpdateAsync(MediaAttachments mediaAttachments)
{
throw new NotImplementedException();
}
public Task RemoveAsync(Guid Id)
{
throw new NotImplementedException();
}
public bool Exists(Guid id)
{
throw new NotImplementedException();
}
public bool Exists(MediaAttachments attachments)
{
throw new NotImplementedException();
}
}