QuoteReplyTopic: How Many Entity Managers should there be in an application? Posted: 29-Dec-2009 at 7:55am
I am building a SL 3 app with Page navigation framework. Currently, I am creating an EM for each page with basically the same model. What is the best way to consolidate using only one EM and have it accessible from all pages? Thoughts and comments appreciated.
The first EntityManager created in your app becomes the default EntityManager, accessible through the EntityManager.DefaultManager property. If no instance has been created, the DefaultManager property returns a new instance of EntityManager, and that instance becomes the default.
So you can initialize your EM on every page as follows:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum