Skip to content

Commit

Permalink
fix: retrieve addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
jvandaal authored and ArneD committed Mar 27, 2024
1 parent 5a3582f commit cce0a08
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,17 @@ public ConsumerAddressContext(DbContextOptions<ConsumerAddressContext> options)

public async Task<List<AddressData>> GetAddresses(List<AddressPersistentLocalId> addressPersistentLocalIds)
{
var ids = addressPersistentLocalIds.Select(x => (int)x).ToList();

var items = AddressConsumerItems
.AsNoTracking()
.Where(x => addressPersistentLocalIds.Contains(new AddressPersistentLocalId(x.AddressPersistentLocalId)));
.Where(x => ids.Contains(x.AddressPersistentLocalId));

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

Expand Down

0 comments on commit cce0a08

Please sign in to comment.