Old forum URL: forums.lhotka.net/forums/t/10663.aspx

rfcdejong posted on Monday, September 05, 2011

In Entity Framework 4.1 and higher there is a new context called DbContext.

DbContext wraps ObjectContext and exposes the most commonly used features of ObjectContext by using simplified and more intuitive APIs. You can access the underlying ObjectContext whenever you need to use features that are not supported by DbContext. For more information, see What’s Not Supported.

CSLA has a ObjectContextManager too reuse a object context while within a single data portal operation. Now this doesn't work having a DbContext as it wraps functionality and only introduces commonly used features.

Is it an idea to create a new class called DbContextManager<C> or perhaps it's not needed at all when using an IoC like unityContainer with a containercontrolled lifetimemanager or Autofac.

RockfordLhotka replied on Monday, September 05, 2011

Thanks for the information. I'll add this to the wish list, because yes, there should be a DbContextManager type in Csla.Data.

We'll have to think about when to add it, because it will couple CSLA to EF 4.1, at least to some degree.

RockfordLhotka replied on Monday, September 05, 2011


Copyright (c) Marimer LLC