Get ChildItems

This commit is contained in:
Christian Arenas 2017-05-16 15:10:23 +02:00
parent 701a0e67e8
commit 888dca003e
2 changed files with 8 additions and 8 deletions

View File

@ -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;
}

View File

@ -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)