Pas sûr pour le imagedata

This commit is contained in:
MarcEricMartel
2022-10-08 13:05:23 -07:00
parent 9de1611b5a
commit 2b7583b045
2 changed files with 14 additions and 8 deletions

View File

@@ -30,12 +30,20 @@ public class ProductController : Controller {
[HttpPost(Name = "Product")]
public void Post(Product prod) {
prod.Id = _context.Products.Count();
try {
_context.Products.Add(prod);
} catch (Exception e) {
_logger.LogError(8, e.Message);
}
}
[HttpPut(Name = "Product")]
public void Put(Product prod) {
try {
_context.Products.Update(prod);
} catch (Exception e) {
_logger.LogError(8, e.Message);
}
}
}