i want to get the method but there are more then one overload. For example in object i tried to get ‘Equals’. When using
public virtual bool Equals(object obj);
public static bool Equals(object objA, object objB);
writing typeof(Object).GetMethod("Equals") got me an exception, writing typeof(Object).GetMethod("public virtual bool Equals(object obj)") got me null. How do i specify which method i want in this case?
Use one of the overloads that lets you specify the parameter types.
For example:
Or alternatively: