I have a simple database with a 'Person
' and a 'Subscription
' table where each person has one or more subscriptions.
private MyDBContext_dbContext;
public T GetByID(int ID)
{
return _dbContext.Mapping. ??
}
Now the intention was to create a generic method to return either a Person entity or a Subscription entity from the datacontext based on the type provided.
In Linq2SQL I was able to use .GetTable<T>
method, how can I do the same here with EntityFramework 6? The .Mapping
part isn't even recognized by intellisense, so i am missing something basic here.
Thanks