Esempio n. 1
0
        public void DeleteProduct(long id)
        {
            Product p = this.GetProduct(id);

            context.Products.Remove(p);
            if (p.Supplier != null)
            {
                context.Remove <Supplier>(p.Supplier);
            }
            context.SaveChanges();
        }
Esempio n. 2
0
        public void DeleteProduct(long id)
        {
            Console.WriteLine("DeleteProduct: " + id);
            Product p = GetProduct(id);

            context.Products.Remove(p);
            if (p.Supplier != null)
            {
                context.Remove <Supplier>(p.Supplier);
            }
            context.SaveChanges();
        }
 public void Delete(long id)
 {
     context.Remove(Get(id));
     context.SaveChanges();
 }
Esempio n. 4
0
 public virtual void Delete(long id)
 {
     context.Remove <T>(Get(id));
     context.SaveChanges();
 }
 public void Delete(long id)
 {
     _databaseContext.Remove <T>(Get(id));
     _databaseContext.SaveChanges();
 }