Dec 17 2021 03:33 AM
Hi,
I am learning .net. I would like to know how can I add and Edit products using webapi, ef core.
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{
int Id;
string Name
String Price
}
any advice. I have done google and found many example that add or edit product as single object but not as collection
Regards
Dec 23 2021 03:10 AM