Exemple #1
0
        // [AllowAnonymous]
        public IActionResult Index()
        {
            var model = new HomeIndexViewModel();

            model.Restaurants    = _restaurantData.GetAllRestaurants();
            model.CurrentMessage = _greeter.GetMessageOfTheDay();

            return(View(model));
        }
 public IActionResult Get()
 {
     try
     {
         return(Ok(_repository.GetAllRestaurants()));
     }
     catch (Exception ex)
     {
         _logger.LogError($"Failed to get restaurants: {ex}");
         return(BadRequest("Failed to get restaurants"));
     }
 }