Client Hub Project
This commit is contained in:
17
ClientHub/Pages/FetchData.razor.cs
Normal file
17
ClientHub/Pages/FetchData.razor.cs
Normal file
@ -0,0 +1,17 @@
|
||||
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));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user