示例#1
0
        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);
        }
示例#2
0
 private Shop()
 {
     context = ShopContextFactory.CreateShopContext();
     //memoryItems.AddRange(context.GetAllItems());
     maxId = Items.Max(item => item.ArticleNumber);
 }