using Microsoft.EntityFrameworkCore; using MTWorkHR.Core.Entities; using MTWorkHR.Core.IRepositories; using MTWorkHR.Infrastructure.DBContext; namespace MTWorkHR.Infrastructure.Repositories { public class InvoiceRepository : Repository, IInvoiceRepository { private readonly DbSet dbSet; public InvoiceRepository(HRDataContext context) : base(context) { dbSet = context.Set(); } public async Task, int>> GetAllUserInvoices(long contractId) { var query = dbSet.Where(a => a.ContractId == contractId).AsQueryable(); var total = await query.CountAsync(); return new Tuple, int>(query, total); } } }