title: How to access Properties of a class from a Generic Method - C#
body: <p>I have a three class which is having following properties</p>
  
  <pre><code>Class A
  {
      public int CustID { get; set; }
      public string Name{ get; set; }
  }
  
  Class B
  {
      public int CustID { get; set; }
      public string Age { get; set; }
  }
  </code></pre>
  
  <p>I created one generic method which accepts all these classes.</p>
  
  <pre><code>public void ProceesData&lt;T&gt;(IList&lt;T&gt; param1, string date1)
  {
      Parallel.ForEach(T, (currentItem) =&gt;
      {
         // I want to aceess CustID property of param1 and pass that value to another function
          GetDetails(CustID );
          RaiseRequest&lt;T&gt;(param1);
      });
  }
  </code></pre>
  
  <p>CustID property is present in Both classes(ie in Class A&amp; Class B).How can i access CustID property in this generic method ? Can anyone help on this</p>