/// <summary>Creates a new rewriterContext with a new query scope with the same parent of the CurrentSelect. </summary> public TranslationContext NewSisterSelect() { var rewriterContext = new TranslationContext(this); rewriterContext._currentScopeIndex = SelectExpressions.Count; SelectExpressions.Add(new SelectExpression(CurrentSelect.Parent, CurrentSelect.Command)); return(rewriterContext); }
public void NewParentSelect() { SelectExpression currentSelect = this.CurrentSelect; SelectExpression newParentSelect = new SelectExpression(currentSelect.Parent, CurrentSelect.Command); currentSelect.Parent = newParentSelect; this._currentScopeIndex = SelectExpressions.Count; SelectExpressions.Add(newParentSelect); }
/// <summary>Creates a new rewriterContext with a new query scope. </summary> public TranslationContext NewSelect() { var rewriterContext = new TranslationContext(this); // scope dependent Parts rewriterContext._currentScopeIndex = SelectExpressions.Count; SelectExpressions.Add(new SelectExpression(CurrentSelect)); return(rewriterContext); }
/// <summary> /// Creates a new BuilderContext with a new query scope which is parent of the current one /// </summary> /// <returns></returns> public void NewParentSelect() { SelectExpression currentSelect = this.CurrentSelect; SelectExpression newParentSelect = new SelectExpression(currentSelect.Parent); while (currentSelect != null) { currentSelect.Parent = newParentSelect; currentSelect = currentSelect.NextSelectExpression; } this.currentScopeIndex = SelectExpressions.Count; SelectExpressions.Add(newParentSelect); }
/// <summary> /// Creates a new BuilderContext with a new query scope with the same parent of the CurrentSelect /// </summary> /// <returns></returns> public BuilderContext NewSisterSelect() { var builderContext = new BuilderContext(); // we basically copy everything builderContext.CallStack = CallStack; builderContext.QueryContext = QueryContext; builderContext.ExpressionQuery = ExpressionQuery; builderContext.MetaTables = MetaTables; builderContext.Parameters = Parameters; builderContext.SelectExpressions = SelectExpressions; builderContext.ExpectMetaTableDefinition = ExpectMetaTableDefinition; // except CurrentScope, of course builderContext.currentScopeIndex = SelectExpressions.Count; SelectExpressions.Add(new SelectExpression(CurrentSelect.Parent)); return(builderContext); }