private IFutureValue <T> ExecuteQueryTreeFutureValue <T>(Expression queryExpression) { var tree = new QueryRelationTree(); IFutureValue <T> result = null; foreach (var path in IncludePaths) { tree.AddNode(path); } var leafs = tree.GetLeafs(); leafs.Sort(); var expressions = leafs.Aggregate(new ExpressionInfo(queryExpression), FetchFromPath).GetExpressions(); var i = 0; foreach (var expression in expressions) { if (i == 0) { result = _queryProvider.ExecuteFutureValue <T>(expression); } else { _queryProvider.ExecuteFuture <T>(expression); } i++; } return(result); }
public IFutureValue <TResult> ExecuteFutureValue <TResult>(Expression expression) { var resultVisitor = new IncludeRewriterVisitor(); expression = resultVisitor.Modify(expression); if (resultVisitor.Count) { return(_queryProvider.ExecuteFutureValue <TResult>(expression)); } if (resultVisitor.SkipTake) { expression = RemoveSkipAndTake(expression); } return(ExecuteQueryTreeFutureValue <TResult>(expression)); }