using Expose.MyIT.Shared.ViewModels; using Microsoft.AspNetCore.Components; using System.Net.Http.Json; namespace Expose.MyIT.Client.Pages; public partial class FetchSsaOrders { [Inject] protected HttpClient? Http { get; set; } private SsaOrder[]? _SsaOrders; //Id //Name //BookingNames //Type //State //ItemNumber //CreatedDate //DecidedDate //Recipient //Requestor protected override async Task OnInitializedAsync() { if (Http is null) throw new NullReferenceException(nameof(Http)); string controllerName = MyIT.Shared.Models.Stateless.Methods.ISsaOrderController.GetRouteName(); _SsaOrders = await Http.GetFromJsonAsync($"api/{controllerName}"); } }