本文整理汇总了C#中System.Linq.Expressions.ExpressionVisitor类的典型用法代码示例。如果您正苦于以下问题:C# ExpressionVisitor类的具体用法?C# ExpressionVisitor怎么用?C# ExpressionVisitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExpressionVisitor类属于System.Linq.Expressions命名空间,在下文中一共展示了ExpressionVisitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor) {
Expression b = visitor.Visit(_body);
if (b == _body) {
return this;
}
return new FinallyFlowControlExpression(b);
}
示例2: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor) {
Expression v = visitor.Visit(_value);
if (v == _value) {
return this;
}
return Utils.MakeYield(_target, v, YieldMarker);
}
示例3: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor) {
Expression v = visitor.Visit(_variable);
if (v == _variable) {
return this;
}
return Utils.Delete(v);
}
示例4: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor) {
Expression body = visitor.Visit(_body);
if (body == _body) {
return this;
}
return new SkipInterpretExpression(body);
}
示例5: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor) {
var instance = visitor.Visit(_expr);
if (instance != _expr) {
return new LightCheckAndThrowExpression(instance);
}
return this;
}
示例6: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor) {
Expression v = visitor.Visit(_value);
if (v == _value) {
return this;
}
return Utils.Assign(_name, v);
}
示例7: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor) {
var expr = visitor.Visit(_expr);
if (expr != _expr) {
return new LightExceptionConvertingExpression(expr, _supportsLightEx);
}
return this;
}
示例8: VisitChildren
/// <summary>
/// Reduces the node and then calls the <see cref="ExpressionVisitor.Visit(System.Linq.Expressions.Expression)" /> method passing the
/// reduced expression.
/// Throws an exception if the node isn't reducible.
/// </summary>
/// <param name="visitor"> An instance of <see cref="ExpressionVisitor" />. </param>
/// <returns> The expression being visited, or an expression which should replace it in the tree. </returns>
/// <remarks>
/// Override this method to provide logic to walk the node's children.
/// A typical implementation will call visitor.Visit on each of its
/// children, and if any of them change, should return a new copy of
/// itself with the modified children.
/// </remarks>
protected override Expression VisitChildren(ExpressionVisitor visitor)
{
visitor.Visit(_tableExpression);
visitor.Visit(_predicate);
return this;
}
示例9: VisitChildren
/// <summary>
/// 简化节点,然后对简化的表达式调用访问者委托。该方法在节点不可简化时引发异常。
/// </summary>
/// <returns>
/// 要访问的表达式,或应在树中替换此表达式的表达式。
/// </returns>
/// <param name="visitor"><see cref="T:System.Func`2"/> 的一个实例。</param>
protected override Expression VisitChildren(ExpressionVisitor visitor)
{
var newArguments = visitor.VisitAndConvert(_arguments, "VisitChildren");
return newArguments != _arguments
? new SqlFunctionExpression(FunctionName, newArguments, Type)
: this;
}
示例10: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor)
{
QueryNode newTarget = (QueryNode)visitor.Visit(Target);
if (newTarget == Target)
return this;
else
return new MergeByName(newTarget);
}
示例11: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor)
{
var arguments = visitor.VisitAndConvert(new ReadOnlyCollection<Expression>(_arguments), "VisitChildren");
return arguments != Arguments
? new SqlFunctionExpression(FunctionName, arguments, Type)
: this;
}
示例12: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor)
{
var newPredicate = visitor.Visit(_predicate);
return _predicate != newPredicate
? new DiscriminatorPredicateExpression(newPredicate, QuerySource)
: this;
}
示例13: Accept
protected override Expression Accept(ExpressionVisitor visitor)
{
var parsedVisitor = visitor as CompilingExpressionVisitor;
if (parsedVisitor != null)
return Accept(parsedVisitor);
return base.Accept(visitor);
}
示例14: VisitChildren
protected override Expression VisitChildren(ExpressionVisitor visitor)
{
var newTimestampExpression = visitor.Visit(TimestampExpression);
return newTimestampExpression != TimestampExpression
? new AtTimeZoneExpression(newTimestampExpression, TimeZone)
: this;
}
示例15: VisitChildren
protected override Expression VisitChildren (ExpressionVisitor visitor)
{
var result = visitor.Visit (_expression);
if (result != _expression)
return new NonReducibleExtensionExpression (result);
return this;
}