Пример #1
0
        public void DeleteProduct1(int cid)
        {
            var rep     = new EfProductService(context);
            var product = rep.GetById(cid);

            if (product != null)
            {
                if (rep.GetAll().Contains(product))
                {
                    rep.Delete(product);
                }
            }
        }
Пример #2
0
        public void PostProduct(Product product)
        {
            var rep = new EfProductService(context);

            rep.Save(product);
        }
Пример #3
0
        public Product GetProduct(int id)
        {
            var rep = new EfProductService(context);

            return(rep.GetById(id));
        }