As always, it depends: -p
If you want to use LINQ extension methods or query syntax, then no: this is closely related to IQueryable<T>
where T
is the source type. Depending on the scenario, there may be an option as a whole:
public IQueryable<T> Get<T>(int id) where T : SomeBaseClass
{
return GetData<T>().Where(row=>row.SomeProp == id);
}
LINQ-to-SQL, , GetTable<T>()
( ). , , (MakeGenericMethod
) - !
?
, , ... , , ExecuteQuery, string .