title: Enum with funciton as a parameter
body: <p>I need to decorate a large list of enums with a function to use, if it's this enum. I currently have this :</p>
  
  <pre><code>public enum AnimalType
  {
      [CustomSet(Helpers.ToUpper)]
      Dog,
      Snake,
      Bird
  }
  
  public class CustomSet : Attribute
  {
      public Func&lt;string, string&gt; Function { get; set; }
  
      public CustomSet(Func&lt;string, string&gt; function)
      {
          Function = function;
      }
  
      public string GetFix (string value)
      {
          return Function(value);
      }
  
  }
  
  public static class Helpers
  {
      public static string ToUpper(string value)
      {
          return value.ToUpper();
      }
  }
  </code></pre>
  
  <p>However, the attribute on the enum gives me an error of </p>
  
  <pre><code>Error   CS0181  Attribute constructor parameter 'function' has type 'Func&lt;string, string&gt;', which is not a valid attribute parameter type   
  </code></pre>
  
  <p>Which I assume is due to the method not being a native type. Can anyone recommend a better way of doing this?</p>
  
  <p>Thanks in advance</p>