예제 #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));
        }