title: How to call function inside custom attribute class
body: <p>Lets say i have the following attribute class.</p>
  
  <pre><code> //Attribute Implementation 
      public abstract class TestAttribute : Attribute
      {
          public abstract void UpdateSomething(string s);
      }
  
  
      public class CustomAttTest : TestAttribute
      {
          private State state;
  
          public CustomAttTest(State state)
          {
              this.state = state;
          }
  
          public override void UpdateSomething(string s)
          {
              if (state.Equals(State.First))
              {
                  Console.WriteLine("First State!! " + s);
              }
          }
      }
  
      public enum State
      {
          First, Second, Third
      }
  </code></pre>
  
  <p>How can i call the Updatesomthing function inside the attribute class?
  following is the attribute implementation example. </p>
  
  <pre><code>    public abstract class Vehicle
      {
          //Coode
      }
  
      [CustomAttTest(State.First)]
      public class Ferrari : Vehicle
      {
          //Code
      }
  </code></pre>
  
  <p>Here is the full code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace ConsoleApplication3
  {
      class Program
      {
          static void Main(string[] args)
          {
              var foo = new Ferrari();
              //How do i call the UpdateSomething implemented insde the CustomAttTest attribute class?
          }
      }
  
      public abstract class Vehicle
      {
          //Coode
      }
  
      [CustomAttTest(State.First)]
      public class Ferrari : Vehicle
      {
          //Code
      }
  
      //Attribute Implementation 
      public abstract class TestAttribute : Attribute
      {
          public abstract void UpdateSomething(string s);
      }
  
  
      public class CustomAttTest : TestAttribute
      {
          private State state;
  
          public CustomAttTest(State state)
          {
              this.state = state;
          }
  
          public override void UpdateSomething(string s)
          {
              if (state.Equals(State.First))
              {
                  Console.WriteLine("First State!! " + s);
              }
          }
      }
  
      public enum State
      {
          First, Second, Third
      }
  
  
  }
  </code></pre>