예제 #1
0
        public async Task <IActionResult> OnGet()
        {
            ViewModel        = new EventsViewModel();
            ViewModel.Events = new List <Event>();
            ViewModel.Events = await _eventData.GetEventsAsync();

            return(Page());
        }
예제 #2
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            EventsViewModel ViewModel = new EventsViewModel();

            ViewModel.Events = new List <Event>();
            ViewModel.Events = await _eventData.GetEventsAsync();

            return(View(ViewModel));
        }