Exemple #1
0
 public IActionResult Get()
 {
     try
     {
         return(Ok(_repository.GetAllProducts()));
     }
     catch (Exception ex)
     {
         _logger.LogError($"Failed to get products: {ex}");
         return(Json("Bad request"));
     }
 }
        public IActionResult Shop()
        {
            var results = _repository.GetAllProducts();

            return(View(results));
        }