Get generic argument type and value supplied to a generic method
问题 How do you get the argument value supplied to a closed/constructed generic method? It's been a while since I haven't touched Reflection. All this used to be at the back of my, umm, whatever. class Program { static void Main(string[] args) { new ConcreteFoo().GenericMethod<int>(5); Console.ReadKey(); } } class ConcreteFoo { public void GenericMethod<Q>(Q q) { var method = MethodInfo.GetCurrentMethod(); var parameters = method.GetParameters(); if (parameters.Length > 0) foreach (var p in