日期:2014-05-18  浏览次数:20943 次

反编译的一个代码,请教这段查询是什么意思?
source = source.Where(Expression.Lambda(Expression.AndAlso(Expression.Call(Expression.Property(expression = Expression.Parameter(typeof(<>f__AnonymousType9<string, string, string, string, int, int, decimal, int>), "c"), (MethodInfo) methodof(<>f__AnonymousType9<string, string, string, string, int, int, decimal, int>.get_p_name, <>f__AnonymousType9<string, string, string, string, int, int, decimal, int>)), (MethodInfo) methodof(string.Contains), new Expression[] { Expression.ArrayIndex(Expression.Constant(slistkey), Expression.Constant(0, typeof(int))) }), Expression.Call(Expression.Property(expression, (MethodInfo) methodof(<>f__AnonymousType9<string, string, string, string, int, int, decimal, int>.get_p_name, <>f__AnonymousType9<string, string, string, string, int, int, decimal, int>)), (MethodInfo) methodof(string.Contains), new Expression[] { Expression.ArrayIndex(Expression.Constant(slistkey), Expression.Constant(1, typeof(int))) })), new ParameterExpression[] { expression })).Take(5);

------解决方案--------------------
你可以学习下表达式树方面的知识。这个代码得耐心分析,而且缺少上下文。

简单地说,你可以在纸上绘制出表达式树(用一个树表示),然后再组合成查询。