Ok so i'm spending some time with the Entity framework and wondered how you guys structure your projects at the moment it seem I have to generate and instance of the Database entity everytime I wish to do somthing,
Is this the best way to do this? Rather than have "ExtLib.DBEntities db = new ExtLib.DBEntities();" in every function?Code:ExtLib.DBEntities db = new ExtLib.DedimiEntities(); ExtLib.Products newProduct = new ExtLib.Products(); newProduct.Name = "Test Product"; db.AddToProducts(newProduct); db.SaveChanges();




Reply With Quote