在LINQ的2 SQL,我可以创建动态使用DataContext.GetTable资源库,有没有实体框架的任何类似apporach不是在特定的语境下的DB即宣布性质4其他
In Linq 2 SQL, I can create the repository dynamically using DataContext.GetTable, is there any similar apporach in Entity Framework 4 other than declaring the properties on the specific DB Context i.e.
public MyDbContext: DbContext
{
public DbSet<MySet> MySets {get; Set;}
}
我想知道我怎么可以创建/获得一个参考MySets动态在LINQ2SQL,如
I would like to know how can I create/get a reference to MySets dynamically as in Linq2Sql, as in
MyDbContext.GetSet<MySet>
感谢
的DbContext
有法这样的:
var set = context.Set<MyEntity>();