Exemple #1
0
        public void SimpleDbTest()
        {
            //Add a product
            var product = new Product()
            {
                ProductName = $"Product {Guid.NewGuid()}"
            };

            _dbRetail.Add(product);
            _dbRetail.SaveChanges();

            //Purge all products
            var products = _dbRetail.Products.ToList();

            foreach (var p in products)
            {
                _dbRetail.Remove(p);
            }
            _dbRetail.SaveChanges();
        }