/// <summary> /// Substitutes any aliased variables in the given expression /// with the function name equivalent. /// </summary> /// <param name="expression"></param> /// <param name="columns"></param> /// <remarks> /// For example, if we have a <c>SELECT 3 + 4 Bah</c> then resolving /// on variable <i>Bah</i> will be subsituted to the function column /// that represents the result of <i>3 + 4</i>. /// </remarks> private static Expression SubstituteAliasedVariables(Expression expression, IList <SelectColumn> columns) { var subs = new VariableSubstitute(columns); return(subs.Substitute(expression)); }
/// <summary> /// Substitutes any aliased variables in the given expression /// with the function name equivalent. /// </summary> /// <param name="expression"></param> /// <param name="columns"></param> /// <remarks> /// For example, if we have a <c>SELECT 3 + 4 Bah</c> then resolving /// on variable <i>Bah</i> will be subsituted to the function column /// that represents the result of <i>3 + 4</i>. /// </remarks> private static Expression SubstituteAliasedVariables(Expression expression, IList<SelectColumn> columns) { var subs = new VariableSubstitute(columns); return subs.Substitute(expression); }