title: Access property of generic class
body: <p>I have a Model-Class that extends a BaseModel-class.</p>
  
  <pre><code>public abstract class BaseModel {
     public abstract string Name;
     public abstract string NamePlural;
     //....
  }
  
  public class Production : BaseModel
  {
     public string Name = "production";
     public string NamePlural = "productions";
     //....
  }
  </code></pre>
  
  <p>Somewhere else I call another class that uses the BaseModel as base for generics:</p>
  
  <pre><code>public class Store {
      public BaseModel SomeMethod&lt;T&gt;()
          where T : BaseModel
      {
           // here I need to get the Name property and the NamePlural property
           T.NamePlural; // gives compile error "T Not valid in the given context
  
           // next try:
           var model = typeof(T);
           model.NamePlural; // simply doesn't exist (model.Name gives the name of the class, but not the property)
  
           // another strange try:
           BaseModel model = new T(); // haha....nope
  
           //....
           return something...;
      }
  }
  
  //usage:
  
  Store store = new Store();
  Production p = SomeMethod&lt;Production&gt;();
  </code></pre>
  
  <p>So <strong>the question is</strong>:<br>
  Is there a simple way to access these properties?<br>
  I even tried via <code>Assembly.GetTypes()..., ...</code></p>
  
  <p>Or do I need <em>another</em> genreric class as described in those answers:
  <a href="https://stackoverflow.com/questions/41438921/how-to-access-property-of-generic-member-in-generic-class">How to access Property of generic member in generic class</a> ?</p>
  
  <p>Yes, I've read related questions 
  <a href="https://stackoverflow.com/questions/24104382/access-to-properties-of-generic-object">Access to properties of generic object</a>
  and <a href="https://stackoverflow.com/questions/14129421/get-property-of-generic-class">Get property of generic class</a></p>