Пример #1
0
        public Product DeleteProduct(int id)
        {
            Product toBeDeleted = context.Find <Product>(id);

            if (toBeDeleted != null)
            {
                context.Remove(toBeDeleted);
                context.SaveChanges();
            }
            return(toBeDeleted);
        }
Пример #2
0
        public Order Delete(int id)
        {
            Order toBeDeleted = context.Find <Order>(id);

            if (toBeDeleted != null)
            {
                context.Remove(toBeDeleted);
                context.SaveChanges();
            }
            return(toBeDeleted);
        }