Is there a way to get ObjectQuery<T> for specfied generic type?
Pseudo:
public partial class MyObjectContext
{
public ObjectSet<TEntity> GetObjectSet<TEntity>()
{
return Helper.GetObjectSet<TEntity>(this);
}
}
Is there a way to get ObjectQuery<T> for specfied generic type?
Pseudo:
public partial class MyObjectContext
{
public ObjectSet<TEntity> GetObjectSet<TEntity>()
{
return Helper.GetObjectSet<TEntity>(this);
}
}
Yes this is what you need:
As you can see your helper method is not needed because you can call
CreateObjectSetdirectly onMyObjectContextinstance. It will returnObjectSet<TEntity>which is derived fromObjectQuery<TEntity>. TEntity must be mapped type and it cannot be derived type in entity hierarchy.