Пример #1
0
        public void deleteProduct(int id)
        {
            var product = new Products
            {
                ProductId = id
            };

            using (var context = new CustomerProductDbContext())
            {
                context.Remove <Products>(product);
                context.SaveChanges();
            }
        }
Пример #2
0
        public void deleteCustomer(int id)
        {
            var customer = new Customers
            {
                CustomerNumber = id
            };

            using (var context = new CustomerProductDbContext())
            {
                context.Remove <Customers>(customer);
                context.SaveChanges();
            }
        }