Skip to content

Commit

Permalink
Updated repository to only retrieve the necessary information for a r…
Browse files Browse the repository at this point in the history
…eport (#4457)
  • Loading branch information
FuriousLlama authored Nov 7, 2024
1 parent 681193a commit 708dc61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
30 changes: 0 additions & 30 deletions source/backend/dal/Repositories/LeasePaymentRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,10 @@ public IEnumerable<PimsLeasePayment> GetAllTracking(DateTime startDate, DateTime
return this.Context.PimsLeasePayments
.AsSplitQuery()
.Include(p => p.LeasePaymentCategoryTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.Lease)
.ThenInclude(p => p.PimsPropertyLeases)
.ThenInclude(p => p.Property)
.ThenInclude(p => p.PimsHistoricalFileNumbers)
.ThenInclude(h => h.HistoricalFileNumberTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.Lease)
.ThenInclude(p => p.RegionCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.Lease)
.ThenInclude(t => t.LeaseStatusTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.Lease)
.ThenInclude(t => t.LeasePayRvblTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.Lease)
.ThenInclude(t => t.PimsLeaseStakeholders)
.ThenInclude(t => t.Person)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.Lease)
.ThenInclude(t => t.LeaseProgramTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.Lease)
.ThenInclude(p => p.PimsLeaseLeasePurposes)
.ThenInclude(c => c.LeasePurposeTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.LeasePeriodStatusTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.LeasePmtFreqTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.Lease)
.ThenInclude(t => t.PimsLeasePeriods)
.ThenInclude(t => t.PimsLeasePayments)
.Where(p => p.PaymentReceivedDate <= endDate && p.PaymentReceivedDate >= startDate);
}
}
Expand Down
4 changes: 4 additions & 0 deletions source/backend/dal/Repositories/LeaseRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ public IEnumerable<PimsLease> GetAllByIds(IEnumerable<long> leaseIds)

IEnumerable<PimsLease> leases = this.Context.PimsLeases.AsSplitQuery().AsNoTracking()
.Include(l => l.PimsPropertyLeases)
.ThenInclude(p => p.Property)
.ThenInclude(p => p.PimsHistoricalFileNumbers)
.ThenInclude(h => h.HistoricalFileNumberTypeCodeNavigation)
.Include(l => l.RegionCodeNavigation)
.Include(l => l.LeaseProgramTypeCodeNavigation)
.Include(l => l.LeasePayRvblTypeCodeNavigation)
Expand All @@ -131,6 +134,7 @@ public IEnumerable<PimsLease> GetAllByIds(IEnumerable<long> leaseIds)
.ThenInclude(p => p.LeasePurposeTypeCodeNavigation)
.Include(l => l.LeaseStatusTypeCodeNavigation)
.Include(l => l.PimsLeaseStakeholders)
.ThenInclude(t => t.Person)
.Include(t => t.PimsPropertyImprovements)
.Include(l => l.PimsInsurances)
.Include(l => l.PimsSecurityDeposits)
Expand Down

0 comments on commit 708dc61

Please sign in to comment.