Skip to content

Commit

Permalink
Merge pull request #662 from bcgov/hotfix
Browse files Browse the repository at this point in the history
chore: group listings performance
  • Loading branch information
ychung-mot authored Sep 20, 2024
2 parents 81d27d7 + 888c875 commit c88d1df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions server/StrDss.Data/Repositories/RentalListingRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public async Task<PagedDto<RentalListingGroupDto>> GetGroupedRentalListings(stri
ApplyFilters(all, address, url, listingId, hostName, businessLicence, prRequirement, blRequirement, lgId, statusArray, reassigned, takedownComplete, ref query);

var groupedQuery = query
.AsNoTracking()
.GroupBy(x => new { x.EffectiveBusinessLicenceNo, x.EffectiveHostNm, x.MatchAddressTxt })
.Select(g => new RentalListingGroupDto
{
Expand Down
7 changes: 4 additions & 3 deletions server/StrDss.Data/Repositories/RepositoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace StrDss.Data.Repositories
{
public interface IRepositoryBase<TEntity>
public interface IRepositoryBase<TEntity>
where TEntity : class
{
Task<PagedDto<TOutput>> Page<TInput, TOutput>(IQueryable<TInput> list, int pageSize, int pageNumber, string orderBy, string direction, string extraSort = "");
Expand Down Expand Up @@ -58,7 +58,7 @@ public async Task<PagedDto<TOutput>> Page<TInput, TOutput>(IQueryable<TInput> li
{
sort = $"{orderBy} {direction}, {extraSort}";
}
else
else
{
sort = $"{extraSort}";
}
Expand Down Expand Up @@ -90,7 +90,8 @@ public async Task<PagedDto<TOutput>> Page<TInput, TOutput>(IQueryable<TInput> li
var pagedDTO = new PagedDto<TOutput>
{
SourceList = outputList,
PageInfo = new PageInfo {
PageInfo = new PageInfo
{
PageNumber = pageNumber,
PageSize = pageSize,
TotalCount = totalRecords,
Expand Down

0 comments on commit c88d1df

Please sign in to comment.