title: Attaching Eventhandler call to Property
body: <p>I have a simple POCO with a lot of Properties. To simplify things let´s assume the POCO looks like this:</p>
  
  <pre><code>public class Project
  {
      public int ProjectId {get; set;}
  }
  </code></pre>
  
  <p>Now I want to create an Event that fires when the ProjectId is changed. What I have now is this:</p>
  
  <pre><code>public class Project
  {
      public int ProjectId {get; set;}
  
      public event EventHandler ProjectChanged;
  
      private void OnProjectChanged(EventArgs args)
      {
          if (ProjectChanged != null) ProjectChanged (this, args);
      }
  }
  </code></pre>
  
  <p>Now I have to extend the Property in order to call the Eventhandler:</p>
  
  <pre><code>public class Project
  {
      private int mProjectId;
      public int ProjectId
      {
          get { return this.mProjectId;}
          set
          {
              this.mProjectId = value;
              this.OnProjectChanged(EventArgs.Empty);
          }
      }
  
      public event EventHandler ProjectChanged;
  
      private void OnProjectChanged(EventArgs args)
      {
          if (ProjectChanged != null) ProjectChanged(this, args);
      }
  }
  </code></pre>
  
  <p>I wonder if there is an easier way to attach the Eventhandler. Maybe some kind of annotation ? Like</p>
  
  <pre><code>public class Project
  {
      [OnChange("OnProjectChanged", EventArgs.Empty)]
      public int ProjectId {get; set;}
  
      public event EventHandler ProjectChanged;
  
      private void OnProjectChanged(EventArgs args)
      {
          if (ProjectChanged != null) ProjectChanged (this, args);
      }
  }
  </code></pre>