private static void ValidateStaticOrInstanceMethod(Expression instance, MethodInfo method)
{
if (method.IsStatic)
{
if (instance != null) throw new ArgumentException(Strings.OnlyStaticMethodsHaveNullInstance, nameof(instance));
}
else
{
if (instance == null) throw new ArgumentException(Strings.OnlyStaticMethodsHaveNullInstance, nameof(method));
RequiresCanRead(instance, nameof(instance));
ValidateCallInstanceType(instance.Type, method);
}
}