public async Task <IActionResult> OnGet() { ViewModel = new EventsViewModel(); ViewModel.Events = new List <Event>(); ViewModel.Events = await _eventData.GetEventsAsync(); return(Page()); }
public async Task <IViewComponentResult> InvokeAsync() { EventsViewModel ViewModel = new EventsViewModel(); ViewModel.Events = new List <Event>(); ViewModel.Events = await _eventData.GetEventsAsync(); return(View(ViewModel)); }