@implements IDisposable @* *@ @* *@
@errMsg
@* @if (appState != null) {
      SessionId: @appState.SessionId
      DateCreated: @appState.DateCreated
      DateExpires: @appState.DateExpires
      IPAddress: @appState.myIpAddress
    
} *@ @code { [CascadingParameter] public CascadingAppState appState { get; set; } #region "IPADDR" [CascadingParameter] HttpContext? HttpContext { get; set; } [Inject] public PersistentComponentState ApplicationState { get; set; } = default!; private PersistingComponentStateSubscription? _persistingSubscription; //private bool _subsequentRender; private string RemoteIpAddress = "Not Set"; protected override void OnInitialized() { this.RemoteIpAddress = this.HttpContext?.Connection.RemoteIpAddress?.ToString() ?? "Not Set"; _persistingSubscription = ApplicationState.RegisterOnPersisting(this.PersistData); } public Task PersistData() { this.ApplicationState.PersistAsJson(ClassObj.IPAddressService.TokenName, this.RemoteIpAddress); return Task.CompletedTask; } void IDisposable.Dispose() { _persistingSubscription?.Dispose(); } #endregion private string errMsg = string.Empty; }