public ProductBrandsDelete DeleteProductBrand(ProductBrandsDelete productBrandsDelete) { using (SqlConnection connection = new SqlConnection(connectionString)) { using (SqlCommand command = new SqlCommand("ProcedureDeleteProductsBrand", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@BrandIDDelete", productBrandsDelete.BrandID); connection.Open(); command.ExecuteNonQuery(); } return(productBrandsDelete); } }
public IActionResult Delete(int id) { ProductBrandsDelete productBrandsDelete = new ProductBrandsDelete(id); return(Ok(new ProductBrandsDataLayer(_configuration).DeleteProductBrand(productBrandsDelete))); }