i want to create a generic class that would accept T.
T is an object coming from Entity Framework representing a Table, or a View of that table.
properties on both would be the same.
I would like to create a generic class, that will accept the table or view, and construct a linq query based on the properties.
so i would need to do something like.. class Foo Where T : myTable or T : myView
so that later i could use the strongly typed properties to construct my predicates.
How could i achieve something like this?
the way i construct my query looks something like this:
if (critera.IsTradeDate)
predicate = PredicateUtility.And(predicate, t => t.DateTrade >= critera.FromDate);
the t is the type that needs to be strong, and properties used will be the same on table and view. So in this case, t should represent either my table or my view, to re-use the code, but still leverage entity framework..