@page "/ranking" @using RankingService @attribute [StreamRendering] Ranking

Ranking

This component demonstrates showing data.

@if (rankings == null) {

Loading...

} else { @for (int i = 0; i < rankings.Length; i++) { }
# Name Time
@(i + 1) @rankings[i].Name @rankings[i].Time
} @code { private RankingClient client = new RankingClient("http://localhost:5072", new HttpClient()); private Competitor[]? rankings; protected override async Task OnInitializedAsync() { rankings = (await client.RankingsAsync()).ToArray(); } }