Reputation:
Suppose there is a function GetEmployees
:
public static List<Employee> GetEmployees(Dictionary<int, Department> depts, bool isFullTime)
{
// How do I get the MethodInfo of this "GetEmployees" function by writing code here?
}
The reason I need to get the MethodInfo inside this function is that I need to know
Thanks!
Upvotes: 0
Views: 99
Reputation: 38737
I expect you want this:
MethodInfo myMethod = MethodInfo.GetCurrentMethod();
And you can get the reflected parameters like so:
ParameterInfo[] parameters = myMethod.GetParameters();
Upvotes: 1