title: Same logic across multiple C# properties?
body: <p>I've joined on a team with a lot of legacy code, and I'm trying to go through and make things a little neater. I see a lot of model and data classes that have copied code that looks like this:</p>
  <pre><code>private string _Info = null;
  public string Info
  {
      get 
      {
          return _Info;
      }
      set
      {
          if (Info != value)
          {
              _Info = value;
              SomeFunctionThatShouldRunOnChange();
          }
      }
  }
  </code></pre>
  <p>And this pattern is copied for MANY properties (500+ lines). Similar but slightly different patterns abound where code is essentially copied for each property.</p>
  <p>What approaches would address this, if any?</p>
  <p>My guesses are:</p>
  <ul>
  <li>Have a small custom class that implements this property</li>
  <li>Have a generic collection backing it that does the same</li>
  </ul>
  <p>I was hoping there would be a clean way to adjust a property as a pattern and use it for multiple variables.</p>
  <p>Thanks!</p>