System.Linq.Error.NoMethodOnType C# (CSharp) Метод

NoMethodOnType() статический приватный Метод

static private NoMethodOnType ( string name, object type ) : Exception
name string
type object
Результат Exception
        internal static Exception NoMethodOnType(string name, object type) =>
            new InvalidOperationException(Strings.NoMethodOnType(name, type));

Usage Example

Пример #1
0
        internal static MethodInfo FindMethod(Type type, string name, ReadOnlyCollection <Expression> args, Type[] typeArgs)
        {
            MethodInfo[] methods = type.GetStaticMethods().Where(m => m.Name == name).ToArray();
            if (methods.Length == 0)
            {
                throw Error.NoMethodOnType(name, type);
            }
            MethodInfo mi = methods.FirstOrDefault(m => ArgsMatch(m, args, typeArgs));

            if (mi == null)
            {
                throw Error.NoMethodOnTypeMatchingArguments(name, type);
            }
            if (typeArgs != null)
            {
                return(mi.MakeGenericMethod(typeArgs));
            }
            return(mi);
        }
All Usage Examples Of System.Linq.Error::NoMethodOnType