Beispiel #1
0
        public Product DeleteProduct(int id)
        {
            Product toBeDeleted = context.Find <Product>(id);

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

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