using APCViewer.Models.Stateless.Methods; using IFX.Shared; using Microsoft.AspNetCore.Mvc.RazorPages; using Serilog.Context; using Shared; using System.Text.Json; namespace APCViewer.Pages; public class TimePivotPage : PageModel, Models.Properties.ITimePivotPage, ITimePivotPage { protected List _ForIPDSF; protected List _ForPDSF; public List ForIPDSF => _ForIPDSF; public List ForPDSF => _ForPDSF; private readonly Serilog.ILogger _Log; private readonly Singleton.Background _Background; private readonly Models.Methods.IBackground _BackgroundMethods; #nullable disable public TimePivotPage(Singleton.Background background) { _Background = background; _BackgroundMethods = background; _Log = Serilog.Log.ForContext(); } #nullable enable public override string ToString() { string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true }); return result; } public void OnGet(bool is_gaN = false, bool is_Si = false) { string? methodName = IMethodName.GetActualAsyncMethodName(); using (LogContext.PushProperty("MethodName", methodName)) { _Log.Debug("() => ..."); Tuple, List> tuple = _BackgroundMethods.GetTimePivot(isGaN: is_gaN, isSi: is_Si); _ForIPDSF = tuple.Item1; _ForPDSF = tuple.Item2; } } }