Exemple #1
0
 /// <summary>
 /// Returns a registered column, or null if not found
 /// This method requires the table to be already registered
 /// </summary>
 /// <param name="table"></param>
 /// <param name="name"></param>
 /// <param name="builderContext"></param>
 /// <returns></returns>
 protected virtual ColumnExpression GetRegisteredColumn(TableExpression table, string name,
                                                        BuilderContext builderContext)
 {
     return
         ((from queryColumn in builderContext.EnumerateScopeColumns()
           where queryColumn.Table.IsEqualTo(table) && queryColumn.Name == name
           select queryColumn).SingleOrDefault());
 }
Exemple #2
0
        /// <summary>
        /// Finds all registered tables or columns with the given name.
        /// We exclude parameter because they won't be prefixed/suffixed the same way (well, that's a guess, I hope it's a good one)
        /// </summary>
        /// <param name="name"></param>
        /// <param name="builderContext"></param>
        /// <returns></returns>
        protected virtual IList <Expression> FindExpressionsByName(string name, BuilderContext builderContext)
        {
            var expressions = new List <Expression>();

            expressions.AddRange((from t in builderContext.EnumerateAllTables() where t.Alias == name select(Expression) t).Distinct());
            expressions.AddRange(from c in builderContext.EnumerateScopeColumns() where c.Alias == name select(Expression) c);
            return(expressions);
        }
 /// <summary>
 /// Finds all registered tables or columns with the given name.
 /// We exclude parameter because they won't be prefixed/suffixed the same way (well, that's a guess, I hope it's a good one)
 /// </summary>
 /// <param name="name"></param>
 /// <param name="builderContext"></param>
 /// <returns></returns>
 protected virtual IList<Expression> FindExpressionsByName(string name, BuilderContext builderContext)
 {
     var expressions = new List<Expression>();
     expressions.AddRange(from t in builderContext.EnumerateAllTables() where t.Alias == name select (Expression)t);
     expressions.AddRange(from c in builderContext.EnumerateScopeColumns() where c.Alias == name select (Expression)c);
     return expressions;
 }