@@ -104,8 +104,6 @@ public async Task<PagedDto<RentalListingGroupDto>> GetGroupedRentalListings(stri
104
104
105
105
_logger . LogInformation ( $ "Get Grouped Listings (group) - Page Size: { pageSize } , Page Number: { pageNumber } , Time: { stopwatch . Elapsed . TotalSeconds } seconds") ;
106
106
107
- stopwatch . Restart ( ) ;
108
-
109
107
foreach ( var group in groupedListings . SourceList )
110
108
{
111
109
group . Listings
@@ -114,10 +112,6 @@ public async Task<PagedDto<RentalListingGroupDto>> GetGroupedRentalListings(stri
114
112
hostName , businessLicence , prRequirement , blRequirement , lgId , statusArray , reassigned , takedownComplete , group ) ;
115
113
}
116
114
117
- _logger . LogInformation ( $ "Get Grouped Listings (listings) - Page Size: { pageSize } , Page Number: { pageNumber } , Time: { stopwatch . Elapsed . TotalSeconds } seconds") ;
118
-
119
- stopwatch . Stop ( ) ;
120
-
121
115
return groupedListings ;
122
116
}
123
117
@@ -217,19 +211,31 @@ private async Task<List<RentalListingViewDto>> GetRentalListings(string? effecti
217
211
string ? all , string ? address , string ? url , string ? listingId , string ? hostName , string ? businessLicence , bool ? prRequirement , bool ? blRequirement ,
218
212
long ? lgId , string [ ] statusArray , bool ? reassigned , bool ? takedownComplete , RentalListingGroupDto group )
219
213
{
214
+ var stopwatch = Stopwatch . StartNew ( ) ;
215
+
220
216
var query = _dbSet . AsNoTracking ( )
221
217
. Where ( x => x . MatchAddressTxt == effectiveAddress && x . EffectiveHostNm == effectiveHostName && x . EffectiveBusinessLicenceNo == effectiveBusinessLicenceNo ) ;
222
218
223
219
ApplyFilters ( all , address , url , listingId , hostName , businessLicence , prRequirement , blRequirement , lgId , statusArray , reassigned , takedownComplete , ref query ) ;
224
220
225
221
var filteredIds = await query . Select ( x => x . RentalListingId ) . ToListAsync ( ) ;
226
222
223
+ stopwatch . Stop ( ) ;
224
+
225
+ _logger . LogInformation ( $ "Get Grouped Listings (filtered listing IDs) - Count: { filteredIds . Count } , Time: { stopwatch . Elapsed . TotalSeconds } seconds") ;
226
+
227
+ stopwatch . Restart ( ) ;
228
+
227
229
var listings = _mapper . Map < List < RentalListingViewDto > > (
228
230
await _dbSet . AsNoTracking ( )
229
231
. Where ( x => x . MatchAddressTxt == effectiveAddress && x . EffectiveHostNm == effectiveHostName && x . EffectiveBusinessLicenceNo == effectiveBusinessLicenceNo )
230
232
. ToListAsync ( )
231
233
) ;
232
234
235
+ _logger . LogInformation ( $ "Get Grouped Listings (all listings) - Count: { listings . Count } , Time: { stopwatch . Elapsed . TotalSeconds } seconds") ;
236
+
237
+ stopwatch . Restart ( ) ;
238
+
233
239
group . NightsBookedYtdQty = 0 ;
234
240
235
241
foreach ( var listing in listings )
@@ -253,6 +259,10 @@ await _dbSet.AsNoTracking()
253
259
group . LastActionDtm = listingWithLatestAction . LastActionDtm ;
254
260
}
255
261
262
+ stopwatch . Stop ( ) ;
263
+
264
+ _logger . LogInformation ( $ "Get Grouped Listings (extra properties) - Count: { listings . Count } , Time: { stopwatch . Elapsed . TotalSeconds } seconds") ;
265
+
256
266
return listings ;
257
267
}
258
268
0 commit comments