public ProductBrandsUpdate UpdateProductBrand(ProductBrandsUpdate productBrandsUpdate) { using (SqlConnection connection = new SqlConnection(connectionString)) { using (SqlCommand command = new SqlCommand("ProcedureUpdateProductsBrand", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@BrandIDUpdate", productBrandsUpdate.BrandID); command.Parameters.AddWithValue("@BrandNameUpdate", productBrandsUpdate.BrandName); connection.Open(); command.ExecuteNonQuery(); } return(productBrandsUpdate); } }
public IActionResult Put([FromBody] ProductBrandsUpdate productBrandsUpdate) { return(Ok(new ProductBrandsDataLayer(_configuration).UpdateProductBrand(productBrandsUpdate))); }