0
Dynamic.csを拡張して、インデクサーでの使用に適格とします。このシナリオでは、コール式に格納されているインデックスを取得する必要があります。デバッガでは、私が見ることができます:linq呼び出しに格納された値を取得する方法式
- left {Param_0.get_Item(0)} System.Linq.Expressions.Expression {System.Linq.Expressions.InstanceMethodCallExpressionN}
- Arguments Count = 1 System.Collections.ObjectModel.ReadOnlyCollection<System.Linq.Expressions.Expression> {System.Runtime.CompilerServices.TrueReadOnlyCollection<System.Linq.Expressions.Expression>}
- [0] {0} System.Linq.Expressions.Expression {System.Linq.Expressions.ConstantExpression}
CanReduce false bool
DebugView "0" string
NodeType Constant System.Linq.Expressions.ExpressionType
+ Type {Name = "Int32" FullName = "System.Int32"} System.Type {System.RuntimeType}
Value 0 object {int}
+ Rohdatenansicht
私が欲しいものです:
left.Arguments[0].Value
私はこの取得できますか?
醜い方法はおそらくleft.ToString()を使用することです。これにより、「Param_0.get_Item(0)」という結果が得られます。そこで、get_Item()のパラメータを抽出できます。しかし、私はこれが正しい方法ではないと思う。
をDynamic.cs何ですか? – svick
@svickあなたはgoogle;を知っていますか?そうでない場合は、[link](http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library。 aspx) – Schorsch