protected virtual void OptimizeQueryModel([NotNull] QueryModel queryModel) { Check.NotNull(queryModel, nameof(queryModel)); _queryOptimizer.Optimize(QueryCompilationContext.QueryAnnotations, queryModel); _navigationRewritingExpressionVisitorFactory.Create(this) .Rewrite(queryModel); queryModel.TransformExpressions(_subQueryMemberPushDownExpressionVisitor.Visit); QueryCompilationContext.Logger .LogDebug( CoreLoggingEventId.OptimizedQueryModel, () => CoreStrings.LogOptimizedQueryModel(queryModel)); }
public string ToString(Expression query) { Expression optimizedQuery = _queryOptimizer.Optimize(query); return(_queryTranslator.Translate(optimizedQuery)); }
private Model.Query VisitQueryModel(QueryModel queryModel) { _modelVisitor = new EntityQueryModelVisitor(_entityContext); _modelVisitor.VisitQueryModel(queryModel); return(_queryOptimizer.Optimize(_modelVisitor.Query)); }