コード例 #1
0
        public IActionResult Index()
        {
            var model = new IndexViewModel
            {
                Restaurants     = _restaurantData.GetAll(),
                MessageOfTheDay = _greetService.GetMessageOfTheDay()
            };

            return(View(model));
        }
コード例 #2
0
        public IViewComponentResult Invoke()
        {
            var model = _greetService.GetMessageOfTheDay();

            return(View("Default", model));
        }
コード例 #3
0
 public void OnGet(string name)
 {
     CurrentGreeting = $"{name} says: {_greetService.GetMessageOfTheDay()} - from Razor Code behind!";
 }