@page "/location/{LocationId:int}" @inject HttpClient http @using CartriX.Web.Pages.LocationsPage.Components @foreach(var printer in printersItems) { } @code { [Parameter] public int LocationId { get; set; } List printersItems = new(); protected override async Task OnInitializedAsync() { await GetPrintersItems(); } async Task GetPrintersItems() { var responce = await http.GetAsync(ApiRoutes.Location.ListPrinters(LocationId)); var json = await responce.Content.ReadAsStringAsync(); printersItems = JsonConvert.DeserializeObject>(json) ?? new(); } }