Files
webdoorcreator/WebDoorCreator.UI/Pages/ForceReload.razor.cs
T
2023-03-30 11:13:46 +02:00

40 lines
925 B
C#

using Microsoft.AspNetCore.Components;
using WebDoorCreator.UI.Data;
namespace WebDoorCreator.UI.Pages
{
public partial class ForceReload
{
#region Public Methods
public async Task flushCache()
{
await Task.Delay(1);
await WDService.FlushRedisCache();
await Task.Delay(1);
// rimando a pagina corrente
NavManager.NavigateTo("/", true);
}
#endregion Public Methods
#region Protected Properties
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await flushCache();
}
#endregion Protected Methods
}
}