Get ChildItems
This commit is contained in:
parent
4cd594bebc
commit
a5b0fd31cb
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
@ -20,10 +18,9 @@ namespace Ordering.API.Application.Sagas
|
||||
public override Order FindSagaById(int id)
|
||||
{
|
||||
var order = _orderingContext.Orders
|
||||
.Single(c => c.Id == id);
|
||||
|
||||
_orderingContext.Entry(order)
|
||||
.Member("OrderStatus");
|
||||
.Include(c => c.OrderStatus)
|
||||
.Include(c => c.OrderItems)
|
||||
.Single(c => c.Id == id);
|
||||
|
||||
return order;
|
||||
}
|
||||
|
@ -33,7 +33,10 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor
|
||||
|
||||
public async Task<Order> GetAsync(int orderId)
|
||||
{
|
||||
return await _context.Orders.FindAsync(orderId);
|
||||
return await _context.Orders
|
||||
.Include(c => c.OrderStatus)
|
||||
.Include(c => c.OrderItems)
|
||||
.SingleAsync(c => c.Id == orderId);
|
||||
}
|
||||
|
||||
public void Update(Order order)
|
||||
|
Loading…
x
Reference in New Issue
Block a user