private static void ThrowUnresolvableFunctionOverload(Expression Expression, bool isAmbiguous)
{
if (Expression.NodeType
== ExpressionType.Call)
{
var methodInfo = ((MethodCallExpression)Expression).Method;
if (isAmbiguous)
{
throw new NotSupportedException(
Strings.ELinq_UnresolvableFunctionForMethodAmbiguousMatch(methodInfo, methodInfo.DeclaringType));
}
else
{
throw new NotSupportedException(
Strings.ELinq_UnresolvableFunctionForMethodNotFound(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_UnresolvableStoreFunctionForMember(memberInfo, memberInfo.DeclaringType));
}
throw new NotSupportedException(Strings.ELinq_UnresolvableStoreFunctionForExpression(Expression.NodeType));
}