title: Get properties from derived class in base class
body: <p>How do I get properties from derived class in base class?</p>
  
  <p>Base class:</p>
  
  <pre><code>public abstract class BaseModel {
      protected static readonly Dictionary&lt;string, Func&lt;BaseModel, object&gt;&gt;
              _propertyGetters = typeof(BaseModel).GetProperties().Where(p =&gt; _getValidations(p).Length != 0).ToDictionary(p =&gt; p.Name, p =&gt; _getValueGetter(p));
  }
  </code></pre>
  
  <p>Derived classes:</p>
  
  <pre><code>public class ServerItem : BaseModel, IDataErrorInfo {
      [Required(ErrorMessage = "Field name is required.")]
      public string Name { get; set; }
  }
  
  public class OtherServerItem : BaseModel, IDataErrorInfo {
      [Required(ErrorMessage = "Field name is required.")]
      public string OtherName { get; set; }
  
      [Required(ErrorMessage = "Field SomethingThatIsOnlyHereis required.")]
      public string SomethingThatIsOnlyHere{ get; set; }
  }
  </code></pre>
  
  <p>In this example - can I get the "Name" property from ServerItem class while in BaseModel class?</p>
  
  <p>EDIT:
  I'm trying to implement model validation, as described here:
  <a href="http://weblogs.asp.net/marianor/archive/2009/04/17/wpf-validation-with-attributes-and-idataerrorinfo-interface-in-mvvm.aspx" rel="noreferrer">http://weblogs.asp.net/marianor/archive/2009/04/17/wpf-validation-with-attributes-and-idataerrorinfo-interface-in-mvvm.aspx</a></p>
  
  <p>I figured that if I create some base model with (almost) all of the validation magic in it, and then extend that model, it will be okay...</p>