public void VerifyEfReadProductsAgain() { IDataManager manager = new EfDataManager(); using (manager.Context) { foreach (var item in manager.ReadProducts(0)) { Trace.WriteLine(item.ProductCode); } } }
public ProductController() { if (ConfigurationManager.AppSettings["DataAccess"].ToUpper() == "ADO") DataManager = new AdoDataManager { ConnectionString = ConfigurationManager.ConnectionStrings["DEMODB"] .ConnectionString }; else DataManager = new EfDataManager(); DataContext = DataManager.Context; }
public void VerifyAddEfItem() { IDataManager manager = new EfDataManager(); using (manager.Context) { manager.InsertProduct(new ProductModel { ProductCode = "WAFLEE", Title = "Southern Waffle General Charger" }); Assert.IsTrue(manager.ReadProducts(10000).Contains(new ProductModel { ProductCode = "WAFLEE" })); } }