Пример #1
0
        public void DeleteProduct(int productId)
        {
            var product = new Product() { Id = productId };
            _context.Entry(product).State = EntityState.Deleted;
            _logger.WriteEntry(string.Format("Product Deleted. Id: '{0}'", product.Id));

        }
Пример #2
0
 public void UpdateProduct(Product product)
 {
     _context.Entry(product).State = EntityState.Modified;
     _logger.WriteEntry(string.Format("Product Updated. SKU: '{0}', Name: '{1}', Price: '{2}', Stock: '{3}'", product.Sku, product.Name, product.Price, product.Stock));
 }