I am new to stackoverflow. I would like to know how can I add and Edit products
for example
[HttpPost("api/products")]
public ActionResult <IEnumerable<Product>> CreateProducts(IEnumerable<Product> products)
{
// Note: I am getting product as collection
// I am using ef core. and would like to add all products
}
[HttpPut("api/products")]
public ActionResult <IEnumerable<Product>> updateProducts(IEnumerable<Product> products)
{
// Note: I am getting product as collection
// I am using ef core. and would like to edit all products
}
class Product
{
public int Id {get;set;}
public string Name {get;set;}
public string Price {get;set;}
}
any advice. I have done google and found many example that add or edit product as single object but not as collection
Regards