public void Save() { //Ignore this if not SaveOnClose if (memoryItems == null) { return; } IShopContext saveContext; if (context == null) { saveContext = ShopContextFactory.CreateShopContext(); } else { saveContext = context; } saveContext.Save(memoryItems); }
private Shop() { context = ShopContextFactory.CreateShopContext(); //memoryItems.AddRange(context.GetAllItems()); maxId = Items.Max(item => item.ArticleNumber); }