// https://github.com/Informatievlaanderen/streetname-registry/blob/550a2398077140993d6e60029a1b831c193fb0ad/src/StreetNameRegistry.Api.Legacy/StreetName/Query/StreetNameBosaQuery.cs#L38 private static IQueryable <StreetNameBosaItem> FilterStreetNames( string persistentLocalId, string version, string streetName, Taal?language, BosaSearchType searchType, IQueryable <StreetNameBosaItem> streetNames, IQueryable <MunicipalityBosaItem> filteredMunicipalities) { var filtered = streetNames.Join( filteredMunicipalities, street => street.NisCode, municipality => municipality.NisCode, (street, municipality) => street); if (!string.IsNullOrEmpty(persistentLocalId)) { filtered = filtered.Where(m => m.PersistentLocalId == persistentLocalId); } if (!string.IsNullOrEmpty(version)) { filtered = filtered.Where(m => m.Version == version); } if (!string.IsNullOrEmpty(streetName)) { filtered = CompareStreetNameByCompareType( filtered, streetName, language, searchType == BosaSearchType.Bevat); } else if (language.HasValue) { filtered = ApplyStreetNameLanguageFilter(filtered, language.Value); } return(filtered); }
// https://github.com/Informatievlaanderen/municipality-registry/blob/054e52fffe13bb4a09f80bf36d221d34ab0aacaa/src/MunicipalityRegistry.Api.Legacy/Municipality/Query/MunicipalityBosaQuery.cs#L83 private static IQueryable <MunicipalityBosaItem> FilterMunicipalities( string nisCode, string version, string municipalityName, Taal?language, BosaSearchType searchType, IQueryable <MunicipalityBosaItem> municipalities) { var filtered = municipalities.Where(x => x.IsFlemishRegion); if (!string.IsNullOrEmpty(nisCode)) { filtered = filtered.Where(m => m.NisCode == nisCode); } if (!string.IsNullOrEmpty(version)) { filtered = filtered.Where(m => m.Version == version); } if (string.IsNullOrEmpty(municipalityName)) { if (language.HasValue) { filtered = ApplyMunicipalityLanguageFilter(filtered, language.Value); } return(filtered); } filtered = CompareMunicipalityByCompareType(filtered, municipalityName, language, searchType == BosaSearchType.Bevat); return(filtered); }