public List <OrderModel> GetOrders(long userId) { var orders = DbContext.GetOrders().Where(o => o.UserId == userId).Select(o => OrderModel.CreateFromEntity(o)).ToList(); var orderItems = DbContext.GetOrderItems(); orders.ForEach(o => { o.Items = orderItems.Where(item => item.OrderId == o.OrderId).Select(item => OrderItemModel.CreateFromEntity(item)).ToList(); }); return(orders); }