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