public void SaveConfiguration(bool memoryStrategy) { var parameters = _context.GeneralParameters.SingleOrDefault(); parameters.MemoryStrategy = memoryStrategy; parameters.MameryStrategyDateChaged = DateTime.Now; _context.SaveChanges(); }
public void Add(Product product) { if (_conf.GetStorageStrategy()) { _context.Products.Add(product); _context.SaveChanges(); } else { MemoryDatabase.products.Add(product); } }