2023-01-13 15:33:58 -07:00

25 lines
824 B
C#

using System.Net.Http.Json;
using Microsoft.AspNetCore.Components;
using ReportingServices.Shared.HelperClasses;
using ReportingServices.Shared.Models.ProductionReport;
namespace ReportingServices.Client.Pages;
public partial class EditDailyReport
{
[Inject] protected HttpClient? HttpClient { get; set; }
[Inject] protected ILogger<EditDailyReport>? Logger { get; set; }
[Parameter] public ManualReportEntries? Rpt { get; set; }
protected override async Task OnInitializedAsync()
{
if (Logger is null)
throw new NullReferenceException(nameof(Logger));
if (HttpClient is null)
throw new NullReferenceException(nameof(HttpClient));
Rpt = await HttpClient.GetFromJsonAsync<ManualReportEntries>("http://localhost:5054/DailyReportInfo.json");
}
}