diff --git a/server/StrDss.Data/Repositories/RentalListingRepository.cs b/server/StrDss.Data/Repositories/RentalListingRepository.cs index 5528d266..350db0c5 100644 --- a/server/StrDss.Data/Repositories/RentalListingRepository.cs +++ b/server/StrDss.Data/Repositories/RentalListingRepository.cs @@ -221,14 +221,14 @@ private static void ApplyFilters(string? all, string? address, string? url, stri if (hostName != null && hostName.IsNotEmpty()) { - var hostNameLower = hostName.ToLower(); - query = query.Where(x => x.ListingContactNamesTxt != null && x.ListingContactNamesTxt.ToLower().Contains(hostNameLower)); + var effectiveHostNm = CommonUtils.SanitizeAndUppercaseString(hostName); + query = query.Where(x => x.EffectiveHostNm != null && x.EffectiveHostNm.StartsWith(effectiveHostNm)); } if (businessLicence != null && businessLicence.IsNotEmpty()) { - var businessLicenceLower = businessLicence.ToLower(); - query = query.Where(x => x.BusinessLicenceNo != null && x.BusinessLicenceNo.ToLower().Contains(businessLicenceLower)); + var effectiveBusinessLicenceNo = CommonUtils.SanitizeAndUppercaseString(businessLicence); + query = query.Where(x => x.EffectiveBusinessLicenceNo != null && x.EffectiveBusinessLicenceNo.StartsWith(effectiveBusinessLicenceNo)); } if (prRequirement != null) @@ -245,7 +245,6 @@ private static void ApplyFilters(string? all, string? address, string? url, stri : x.IsBusinessLicenceRequired == null || x.IsBusinessLicenceRequired == false); } - if (reassigned != null && reassigned.Value == false) { reassigned = null;