예제 #1
0
        public void Remove(Brand brand)
        {
            Guard.Null(brand, nameof(brand));
            Guard.NegativeOrZero(brand.Id, nameof(brand.Id));

            _catalogDbContext.Entry(brand).State = EntityState.Deleted;
            _catalogDbContext.Brands.Remove(brand);
            _catalogDbContext.SaveChanges();
        }
예제 #2
0
        public void Remove(int supplierId)
        {
            var supplier = new Supplier()
            {
                Id = supplierId
            };

            _catalogDbContext.Entry(supplier).State = EntityState.Deleted;
            Remove(supplier);
        }