diff --git a/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs b/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs index 1047d6c7e..c6d57b17b 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs @@ -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 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)