42 lines
1016 B
Plaintext
42 lines
1016 B
Plaintext
@page "/fetchdata"
|
|
|
|
@using OI.Metrology.ClientHub.Data
|
|
@using Microsoft.AspNetCore.Components.Web
|
|
|
|
@namespace OI.Metrology.ClientHub.Pages
|
|
|
|
<PageTitle>Weather forecast</PageTitle>
|
|
|
|
<h1>Weather forecast</h1>
|
|
|
|
<p>This component demonstrates fetching data from a service.</p>
|
|
|
|
@if (_WeatherForecasts is null)
|
|
{
|
|
<p><em>Loading...</em></p>
|
|
}
|
|
else
|
|
{
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Date</th>
|
|
<th>Temp. (C)</th>
|
|
<th>Temp. (F)</th>
|
|
<th>Summary</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (WeatherForecast weatherForecast in _WeatherForecasts)
|
|
{
|
|
<tr>
|
|
<td>@weatherForecast.Date.ToShortDateString()</td>
|
|
<td>@weatherForecast.TemperatureC</td>
|
|
<td>@weatherForecast.TemperatureF</td>
|
|
<td>@weatherForecast.Summary</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|