Skip to content

Commit 1075910

Browse files
author
ericuss
committed
temporal fix to get the order in local dbset of orders for UpdateOrderWhenBuyerAndPaymentMethodVerifiedDomainEventHandler.cs
1 parent 4398b25 commit 1075910

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public OrderRepository(OrderingContext context)
2828
public Order Add(Order order)
2929
{
3030
return _context.Orders.Add(order).Entity;
31-
31+
3232
}
3333

3434
public async Task<Order> GetAsync(int orderId)
@@ -37,6 +37,14 @@ public async Task<Order> GetAsync(int orderId)
3737
.Orders
3838
.Include(x => x.Address)
3939
.FirstOrDefaultAsync(o => o.Id == orderId);
40+
if (order == null)
41+
{
42+
43+
order = _context
44+
.Orders
45+
.Local
46+
.FirstOrDefault(o => o.Id == orderId);
47+
}
4048
if (order != null)
4149
{
4250
await _context.Entry(order)

0 commit comments

Comments
 (0)