Example #1
0
 public ActionResult <IEnumerable <Product> > Get()
 {
     try
     {
         return(Ok(repository.GetAllProducts()));
     }
     catch (Exception ex)
     {
         logger.LogError($"Failed to get products {ex}.");
         return(BadRequest("Failed to get products"));
     }
 }