Code: Select all
@page "/"
@using System.Net.Http.Json
Blazing Pizzas
[list]
@if (specials != null)
{
@foreach (var special in specials)
{
[*]
@special.Name
@special.Description
@special.GetFormattedBasePrice()
}
}
[/list]
@code
{
// List of special offers
List
specials = new();
protected override async Task OnInitializedAsync()
{
specials = await HttpClient.GetFromJsonAsync(NavigationManager.BaseUri + "specials");
}
}
Mobile version