Sharing Context Manager with EF Like Linq?

Sharing Context Manager with EF Like Linq?

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


Chaz4Code posted on Monday, May 11, 2009

Has anyone worked out how to share the Context of an Entity Framework model in the same way the Linq Context is shared in the Project Tracker application?  Basically I want to replace

using (var ctx = ContextManager<ProjectTracker.DalLinq.PTrackerDataContext>.GetManager(ProjectTracker.DalLinq.Database.PTracker))

with an Entity Framework context instead.  I checked out 3.62 example and it looks like Rocky hasn't gotten to it yet.  I can do it old school and pass it in like we used to do with ADO.Net in CSLA 2.x but if there is a more elegant way to share the context with the child objects I'd prefer that.

 

JonnyBee replied on Sunday, June 07, 2009

Hi,

Use the ObjectContextManager for Entity Framework.

Download the Rolodex sample for Sergey Barskiy's blog - very good example of using CSLA and Linq2EF.

/jonny


Copyright (c) Marimer LLC