private static void ThrowUnresolvableFunction(Expression Expression)
{
if (Expression.NodeType
== ExpressionType.Call)
{
var methodInfo = ((MethodCallExpression)Expression).Method;
throw new NotSupportedException(Strings.ELinq_UnresolvableFunctionForMethod(methodInfo, methodInfo.DeclaringType));
}
else if (Expression.NodeType
== ExpressionType.MemberAccess)
{
string memberName;
Type memberType;
var memberInfo = TypeSystem.PropertyOrField(((MemberExpression)Expression).Member, out memberName, out memberType);
throw new NotSupportedException(Strings.ELinq_UnresolvableFunctionForMember(memberInfo, memberInfo.DeclaringType));
}
throw new NotSupportedException(Strings.ELinq_UnresolvableFunctionForExpression(Expression.NodeType));
}