예제 #1
0
        public void SaveConfiguration(bool memoryStrategy)
        {
            var parameters = _context.GeneralParameters.SingleOrDefault();

            parameters.MemoryStrategy           = memoryStrategy;
            parameters.MameryStrategyDateChaged = DateTime.Now;

            _context.SaveChanges();
        }
예제 #2
0
 public void Add(Product product)
 {
     if (_conf.GetStorageStrategy())
     {
         _context.Products.Add(product);
         _context.SaveChanges();
     }
     else
     {
         MemoryDatabase.products.Add(product);
     }
 }