using Expose.MyIT.Shared.ViewModels; using Microsoft.AspNetCore.Components; using System.Net.Http.Json; namespace Expose.MyIT.Client.Pages; public partial class FetchData { [Inject] protected HttpClient? Http { get; set; } private WeatherForecast[]? _Forecasts; protected override async Task OnInitializedAsync() { if (Http is null) throw new NullReferenceException(nameof(Http)); string controllerName = MyIT.Shared.Models.Stateless.Methods.IWeatherForecastController.GetRouteName(); // _SsaOrders = await Http.GetFromJsonAsync("sample-data/weather.json"); _Forecasts = await Http.GetFromJsonAsync($"api/{controllerName}"); } }