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...
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? IList<NewProduct>, IList<OldProduct>
public static IList<T> GenericFunction<T>(IList<T> objList)
{
IList<T> filteredData = objList.Where(p => p.Price > 0));
}