Skip to content

Commit

Permalink
chore: enhance count query
Browse files Browse the repository at this point in the history
  • Loading branch information
ychung-mot committed Nov 21, 2024
1 parent 5097352 commit f7dfe6f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions server/StrDss.Data/Repositories/RentalListingRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,8 @@ public async Task<int> GetGroupedRentalListingsCount(string? all, string? addres
ApplyFilters(all, address, url, listingId, hostName, businessLicence, prRequirement, blRequirement, lgId, statusArray, reassigned, takedownComplete, ref query);

var count = await query
.GroupBy(x => new { x.EffectiveBusinessLicenceNo, x.EffectiveHostNm, x.MatchAddressTxt })
.Select(g => new RentalListingGroupDto
{
EffectiveBusinessLicenceNo = g.Key.EffectiveBusinessLicenceNo,
EffectiveHostNm = g.Key.EffectiveHostNm,
MatchAddressTxt = g.Key.MatchAddressTxt
})
.Select(x => new { x.EffectiveBusinessLicenceNo, x.EffectiveHostNm, x.MatchAddressTxt })
.Distinct()
.CountAsync();

stopwatch.Stop();
Expand Down

0 comments on commit f7dfe6f

Please sign in to comment.