Skip to content

Commit

Permalink
fix: wms address housenumberlabel
Browse files Browse the repository at this point in the history
  • Loading branch information
emalfroy committed Jan 19, 2024
1 parent aecbc6e commit 1903185
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private static async Task<IList<AddressWmsItemV2>> FindAddressesWithSharedPositi
string? status,
CancellationToken ct)
{
var localItems = context
var localFilteredItems = context
.AddressWmsItemsV2
.Local
.Where(i => i.PositionX == position.X
Expand All @@ -99,6 +99,8 @@ private static async Task<IList<AddressWmsItemV2>> FindAddressesWithSharedPositi
&& !i.Removed)
.ToList();

var localItems = context.AddressWmsItemsV2.Local.ToList();

var dbItems = await context.AddressWmsItemsV2
.Where(i => i.PositionX == position.X
&& i.PositionY == position.Y
Expand All @@ -118,12 +120,12 @@ private static async Task<IList<AddressWmsItemV2>> FindAddressesWithSharedPositi
var verifiedDbItems = new List<AddressWmsItemV2>();
foreach (var dbItem in dbItems)
{
if (localItems.Any(x => x.AddressPersistentLocalId == dbItem.AddressPersistentLocalId))
if (localFilteredItems.Any(x => x.AddressPersistentLocalId == dbItem.AddressPersistentLocalId))
{
continue;
}

if (context.AddressWmsItemsV2.Local.Any(x =>
if (localItems.Any(x =>
x.AddressPersistentLocalId == dbItem.AddressPersistentLocalId))
{
continue;
Expand All @@ -132,7 +134,7 @@ private static async Task<IList<AddressWmsItemV2>> FindAddressesWithSharedPositi
verifiedDbItems.Add(dbItem);
}

var union = localItems
var union = localFilteredItems
.Union(verifiedDbItems)
.ToList();

Expand Down

0 comments on commit 1903185

Please sign in to comment.