title: Creating a generic function in c# that only works with specific types
body: <p>I am trying to create a Generic function that handles either of my 2 models. Note that both of these models have the same exact properties...</p>
  
  <p>For example, in the below code the intellisense has no idea that there is a property called Price in T even though both 'NewProduct' and 'OldProduct' have this property. How can I specify to VS the two Types that I want to be able to pass in? <code>IList&lt;NewProduct&gt;, IList&lt;OldProduct&gt;</code></p>
  
  <pre><code>public static IList&lt;T&gt; GenericFunction&lt;T&gt;(IList&lt;T&gt; objList)
  {
      IList&lt;T&gt; filteredData = objList.Where(p =&gt; p.Price &gt; 0));
  }
  </code></pre>