title: Calling a method by enum Attribute in C#
body: <p>First, I'm so sorry because my bellow stupid question. But I hope someone can help me on this approach.</p>
  
  <p>I have an Enum that I want to be add new magic attribute as described:</p>
  
  <pre><code>public enum FunctionType
      {
          [CallMethod(ExecuteFunction.DOPLUS)] //How to implement CallMethod magic attribute
          PLUS,
          [CallMethod(ExecuteFunction.DOMINUS)]
          MINUS,
          [CallMethod(ExecuteFunction.DOMULTIPLY)]
          MULTIPLY,
          [CallMethod(ExecuteFunction.DODIVIDE)]
          DIVIDE
      }
  </code></pre>
  
  <p>My class has a FunctionType property like this:</p>
  
  <pre><code>public class Function
      {
          private FunctionType _functionType;
  
          public List&lt;object&gt; Params
          { get; set; }
  
          public FunctionType FunctionType
          {
              get { return _functionType; }
              set { _functionType = value; }
          }
  
          public string Execute()
          {
              return SomeMagicMethod(this.FunctionType); //How to implement this method to return my result as expected
          }
      }
  </code></pre>
  
  <p>Last, my calculate class has some functions return result:</p>
  
  <pre><code>public static class ExecuteFunction
      {
          public static string DOPLUS(int a, int b)
          {
              return (a + b).ToString();
          }
  
          public static string DOMINUS(int a, int b)
          {
              return (a - b).ToString();
          }
  
          public static string DOMULTIPLY(int a, int b)
          {
              return (a * b).ToString();
          }
  
          public static string DODIVIDE(int a, int b)
          {
              return (a / b).ToString();
          }
      }
  </code></pre>
  
  <p>My stupid question is: How can I implement CallMethodAttribute in enum and SomeMagicMethod above to run specified method without using switch case as normal ?</p>