Skip to content

Commit

Permalink
fix: consumeraddresscontext get addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Mar 27, 2024
1 parent c0293ae commit 5995753
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/BuildingRegistry.Consumer.Address/ConsumerAddressContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,19 @@ public async Task<List<AddressData>> GetAddresses(List<AddressPersistentLocalId>
.AsNoTracking()
.Where(x => ids.Contains(x.AddressPersistentLocalId));

return await items
return (await items
.Select(x =>
new {
x.AddressPersistentLocalId,
x.Status,
x.IsRemoved
})
.ToListAsync())
.Select(x => new AddressData(
new AddressPersistentLocalId(x.AddressPersistentLocalId),
Map(x.Status),
x.IsRemoved))
.ToListAsync();
.ToList();
}

public BuildingRegistry.Building.Datastructures.AddressStatus Map(AddressStatus status)
Expand Down

0 comments on commit 5995753

Please sign in to comment.