public ProductBrandInsert InsertProductBrand(ProductBrandInsert productBrandInsert) { using (SqlConnection connection = new SqlConnection(connectionString)) { using (SqlCommand command = new SqlCommand("ProcedureInsertProductsBrand", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@ProductBrandName", productBrandInsert.BrandName); connection.Open(); command.ExecuteNonQuery(); } return(productBrandInsert); } }
//[Consumes("application/json")] public IActionResult Post([FromBody] ProductBrandInsert productBrandInsert) { return(Ok(new ProductBrandsDataLayer(_configuration).InsertProductBrand(productBrandInsert))); }