public static IsConvertWithMethod ( |
||
e | ||
methodName | string | |
argumentCount | int | |
Résultat | bool |
public override Expression VisitConditional(ConditionalExpression c) { if (ExpressionUtils.IsRedundantEqualityTest(c)) { if (ExpressionUtils.IsConvertWithMethod(c.IfFalse, "Contains")) { return(Visit((c.IfFalse as UnaryExpression).Operand)); } else { return(Visit(c.IfFalse)); } } return(base.VisitConditional(c)); }
public override Expression VisitUnary(UnaryExpression u) { if (u.NodeType == ExpressionType.Convert && ExpressionUtils.IsConvertWithMethod(u, "get_Item")) { var callExpression = u.Operand as MethodCallExpression; return(Visit(Expression.Call( Visit(callExpression.Object), typeof(DSPResource).GetMethod("GetValue", new Type[] { typeof(string) }), callExpression.Arguments))); } if (u.NodeType == ExpressionType.TypeAs && u.Type == typeof(BsonDocument)) { return(Expression.TypeAs(u.Operand, typeof(DSPResource))); } else { return(base.VisitUnary(u)); } }