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(); }
public void Remove(int supplierId) { var supplier = new Supplier() { Id = supplierId }; _catalogDbContext.Entry(supplier).State = EntityState.Deleted; Remove(supplier); }