Describe the issue
Info.MethodOf documentation is somewhat unclear regarding generic methods and parameters.
Below are some of my attempts that came up short.
Minimal Repro
namespace MyNs
{
public class MyClass
{
// OK
public static readonly MethodInfo ProduceMethod = Info.OfMethod<MyClass>(nameof(Produce)); // OK
public static readonly MethodInfo ProduceMethod2 = Info.OfMethod("InfoOfMethodOverload", "MyNs.MyClass", "Produce"); // OK
public int Produce() => throw new NotImplementedException();
// What do I do?
//public static readonly MethodInfo ProduceGeneric = Info.OfMethod<MyClass>(nameof(Produce)+"``1<T>");
//public static readonly MethodInfo ProduceGeneric = Info.OfMethod("InfoOfMethodOverload", "MyNs.MyClass", nameof(Produce)+"``1<T>");
//public static readonly MethodInfo ProduceGeneric = Info.OfMethod("InfoOfMethodOverload", "MyNs.MyClass", nameof(Produce)+"``1<mscorlib|System.Int32>");
public int Produce<T>() => throw new NotImplementedException();
// What do I do?
//public static readonly MethodInfo ProduceWithParam = Info.OfMethod<MyClass>(nameof(Produce), "System.Runtime|System.Int32");
//public static readonly MethodInfo ProduceWithParam2 = Info.OfMethod("InfoOfMethodOverload", "MyNs.MyClass", "Produce", "mscorlib|System.Int32");
//public static readonly MethodInfo ProduceWithParam2 = Info.OfMethod("InfoOfMethodOverload", "MyNs.MyClass", "Produce", "int");
public int Produce(int z) => throw new NotImplementedException();
}
}
Describe the issue
Info.MethodOfdocumentation is somewhat unclear regarding generic methods and parameters.Below are some of my attempts that came up short.
Minimal Repro