Esempio n. 1
0
 public ActionResult <IEnumerable <Product> > Get()
 {
     try
     {
         return(Ok(_repository.GetAllProducts()));
     }
     catch (Exception ex)
     {
         _logger.LogError($"Failed to get products:{ex}");
         return(BadRequest("Bad request"));
     }
 }
        public IActionResult Shop()
        {
            var results = _repostory.GetAllProducts();

            return(View(results));
        }