File tree Expand file tree Collapse file tree
Ordering.API/Application/Sagas
Ordering.Infrastructure/Repositories Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
1+ using System . Linq ;
42using System . Threading . Tasks ;
53using Microsoft . EntityFrameworkCore ;
64using Microsoft . eShopOnContainers . Services . Ordering . Domain . AggregatesModel . OrderAggregate ;
@@ -20,10 +18,9 @@ public OrderSaga(OrderingContext orderingContext) : base(orderingContext)
2018 public override Order FindSagaById ( int id )
2119 {
2220 var order = _orderingContext . Orders
23- . Single ( c => c . Id == id ) ;
24-
25- _orderingContext . Entry ( order )
26- . Member ( "OrderStatus" ) ;
21+ . Include ( c => c . OrderStatus )
22+ . Include ( c => c . OrderItems )
23+ . Single ( c => c . Id == id ) ;
2724
2825 return order ;
2926 }
Original file line number Diff line number Diff line change @@ -33,7 +33,10 @@ public Order Add(Order order)
3333
3434 public async Task < Order > GetAsync ( int orderId )
3535 {
36- return await _context . Orders . FindAsync ( orderId ) ;
36+ return await _context . Orders
37+ . Include ( c => c . OrderStatus )
38+ . Include ( c => c . OrderItems )
39+ . SingleAsync ( c => c . Id == orderId ) ;
3740 }
3841
3942 public void Update ( Order order )
You can’t perform that action at this time.
0 commit comments