EF4 CTP5: Inheriting DbContext

I have a hierarchical structure DbContextwhere I would like a specialist DbContextwith his own DbSetsinherit DbSetsfrom BaseDbContext.

When accessing the base ObjectContextusing (( IObjectContextAdapter)). ObjectContextreceiving ObjectContexttakes too much time (several minutes).

Is there a problem with DbContextin CT5 that getting ObjectContextfrom a derivative is DbContextnot possible?

Structure: DbContext(EF4) -> myBaseDbContext -> mySpecializedDbContext.

Does anyone have any idea what is going on in this scenario? It is just POCO (CF) with TPC and little inheritance.

+3
source share
1 answer

, DbSets:

public class MyContext: DbContext
    {       
       //your DbSets<> and other

       public ObjectContext ObjectContext()
       {
          return (this as IObjectContextAdapter).ObjectContext;
       }
    }
0

All Articles