Is there anyway in C# to call a method based on a Enum and/or class? Say if I were to call
Controller<Actions.OnEdit, Customer>(customer);
Could I do something like this then?
public void Controller<TAction, TParam>(TParam object)
{
Action<TParam> action = FindLocalMethodName(TAction);
action(object);
}
private Action<T> FindLocalMethodName(Enum method)
{
//Use reflection to find a metode with
//the name corresponding to method.ToString()
//which accepts a parameters type T.
}