17 lines
561 B
C#
17 lines
561 B
C#
using Microsoft.AspNetCore.Components;
|
|
using OI.Metrology.ClientHub.Data;
|
|
|
|
namespace OI.Metrology.ClientHub.Pages;
|
|
|
|
public partial class FetchData
|
|
{
|
|
private WeatherForecast[]? _WeatherForecasts;
|
|
[Inject] protected WeatherForecastService? ForecastService { get; set; }
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
if (ForecastService is null)
|
|
throw new NullReferenceException(nameof(ForecastService));
|
|
_WeatherForecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now));
|
|
}
|
|
} |