コード例 #1
0
        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();
        }
コード例 #2
0
ファイル: Booking.razor.cs プロジェクト: jakarlse88/p8
        /// <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);
        }