public IActionResult GetAllProducts()
 {
     try
     {
         return(Ok(_mapper.ParseProduct(_productService.GetAllProducts())));
     } catch (Exception)
     {
         return(BadRequest());
     }
 }
Beispiel #2
0
 public Model.Product AddProduct(Model.Product newProduct)
 {
     _context.Products.Add(_mapper.ParseProduct(newProduct));
     _context.SaveChanges();
     return(newProduct);
 }