protected override async Task OnInitializedAsync() { Status = APIOperationStatus.Initial; Consultants = new List <ConsultantViewModel>(); var requestUrl = Env.IsDevelopment() ? "https://localhost:5009/client-gw/consultant" : "https://localhost:8088/client-gw/consultant"; try { Consultants = await ApiRequestService.HandleGetRequest <IEnumerable <ConsultantViewModel> >(requestUrl); Status = APIOperationStatus.GET_Success; } catch (Exception e) { Console.WriteLine(e); Status = APIOperationStatus.GET_Error; } StateHasChanged(); await base.OnInitializedAsync(); }
/// <summary> /// Fetch information/options from the API services. /// </summary> /// <returns></returns> private async Task <BookingViewModel> FetchBookingInfo() { var requestUrl = Env.IsDevelopment() ? "https://localhost:5009/client-gw/aggregate" : "https://localhost:8088/client-gw/aggregate"; var result = await ApiRequestService.HandleGetRequest <BookingViewModel>(requestUrl); return(result); }