コード例 #1
0
        public void Delete(int id)
        {
            Provider provider = _context.Providers.Find(id);

            if (provider != null)
            {
                _context.Providers.Remove(provider);
            }
            _context.Entry(provider).State = EntityState.Deleted;
            _context.SaveChanges();
        }
コード例 #2
0
        public void Delete(int id)
        {
            Storage storage = _context.Storages.Find(id);

            if (storage != null)
            {
                _context.Storages.Remove(storage);
            }
            _context.Entry(storage).State = System.Data.Entity.EntityState.Deleted;
            _context.SaveChanges();
        }
コード例 #3
0
        public void Delete(int id)
        {
            TypeProduct typeProduct = _context.TypeProducts.Find(id);

            if (typeProduct != null)
            {
                _context.TypeProducts.Remove(typeProduct);
            }
            _context.Entry(typeProduct).State = System.Data.Entity.EntityState.Deleted;
            _context.SaveChanges();
        }