Browse Source

temporal fix to get the order in local dbset of orders for UpdateOrderWhenBuyerAndPaymentMethodVerifiedDomainEventHandler.cs

features/migration-dotnet3
ericuss 5 years ago
parent
commit
10759109ab
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs

+ 9
- 1
src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs View File

@ -28,7 +28,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor
public Order Add(Order order)
{
return _context.Orders.Add(order).Entity;
}
public async Task<Order> GetAsync(int orderId)
@ -37,6 +37,14 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor
.Orders
.Include(x => x.Address)
.FirstOrDefaultAsync(o => o.Id == orderId);
if (order == null)
{
order = _context
.Orders
.Local
.FirstOrDefault(o => o.Id == orderId);
}
if (order != null)
{
await _context.Entry(order)


Loading…
Cancel
Save