using Microsoft.EntityFrameworkCore;
using MTWorkHR.Core.Entities;
using MTWorkHR.Core.IDto;
using MTWorkHR.Infrastructure.Entities;
using MTWorkHR.Infrastructure.DBContext;
using MTWorkHR.Core.IRepositories;

namespace MTWorkHR.Infrastructure.Repositories
{
    public class UserTaskAttachmentRepository : Repository<UserTaskAttachment>, IUserTaskAttachmentRepository
    {
        private readonly DbSet<UserTaskAttachment> dbSet;

        public UserTaskAttachmentRepository(HRDataContext context) : base(context)
        {
            dbSet = context.Set<UserTaskAttachment>();

        }
        public async Task<Tuple<IQueryable<UserTaskAttachment>, int>> GetAllWithChildrenAsync()
        {
            var query = dbSet.AsQueryable();
            var total = await query.CountAsync();

            return new Tuple<IQueryable<UserTaskAttachment>, int>(query, total);
        }
    }
}
