Пример #1
0
        public async Task <IActionResult> OnGet()
        {
            if (SearchTerm is null)
            {
                Conferences = (List <ConferenceResponse>) await _apiClient.GetConferencesAsync();
            }
            else
            {
                Conferences = ((List <ConferenceResponse>) await _apiClient.GetConferencesAsync()).FindAll(x => x.Name.ToLowerInvariant().Contains(SearchTerm.ToLowerInvariant()));
            }


            if (Conferences is null || Conferences.Count == 0)
            {
                return(RedirectToPage("/Error"));
            }

            return(Page());
        }