Print Page | Close Window

Instantianting the entity model

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2164
Printed Date: 29-Aug-2025 at 10:03am


Topic: Instantianting the entity model
Posted By: BillG
Subject: Instantianting the entity model
Date Posted: 16-Sep-2010 at 9:57am
In your samples for Silverlight, you show in the ViewModel class that you do the following
 
mgr = new NorthWindEntities();
 
I don't really want to do that in everyone of my ViewModel classes do I? Won't that hurt performance? Should I create a singleton class for this purpose or does it matter?
 
Bill
 



Replies:
Posted By: davidklitzke
Date Posted: 16-Sep-2010 at 11:47am
You probably don't want to create multiple EntityManagers in your application.  You probably want just one.  You could create a singleton class to do this.  If you do want to use multiple EntityManagers, consult the DevForce Resource Center.

http://drc.ideablade.com/xwiki/bin/view/Documentation/EntityCaching





Print Page | Close Window