本文整理汇总了C#中System.Linq.Expressions.Expression.Recurse方法的典型用法代码示例。如果您正苦于以下问题:C# Expression.Recurse方法的具体用法?C# Expression.Recurse怎么用?C# Expression.Recurse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Linq.Expressions.Expression
的用法示例。
在下文中一共展示了Expression.Recurse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GroupExpression
public GroupExpression(Expression groupedExpression, Expression keyExpression)
: base(ExpressionType, groupedExpression.Type)
{
GroupedExpression = groupedExpression;
KeyExpression = keyExpression;
Clauses = new List<Expression>();
// extract columns (for SQL build)
keyExpression.Recurse(
delegate(Expression e)
{
if (e is ColumnExpression)
Clauses.Add(e);
return e;
}
);
}
示例2: Translate
/// <summary>
/// Translate a hierarchy's SpecialExpressions to Expressions
/// </summary>
/// <param name="expression"></param>
/// <returns></returns>
public Expression Translate(Expression expression)
{
return expression.Recurse(Analyzer);
}
示例3: IsHavingClause
protected virtual bool IsHavingClause(Expression expression)
{
bool isHaving = false;
expression.Recurse(delegate(Expression e)
{
if (e is GroupExpression)
isHaving = true;
return e;
});
return isHaving;
}
示例4: Parse
public virtual Expression Parse(Expression expression, BuilderContext builderContext)
{
return expression.Recurse(e => Analyze(e, builderContext));
}
示例5: GetChildColumns
//RI: adding this to get all child columns in GroupExpression
private IList<ColumnExpression> GetChildColumns(Expression expression, TranslationContext context)
{
var columns = new List<ColumnExpression>();
// extract columns (for SQL build)
expression.Recurse(
delegate(Expression e) {
if (e is ColumnExpression)
columns.Add((ColumnExpression)e);
else if (e is TableExpression) {
var t = (TableExpression)e;
columns.AddRange(RegisterAllColumns(t, context));
}
return e;
}//
);
return columns;
}
示例6: Optimize
public virtual Expression Optimize(Expression expression, TranslationContext rewriterContext)
{
return expression.Recurse(e => Analyze(e, rewriterContext));
}