@implements IDisposable;

@inject IEntityDialogService entityDialogService

@if (entityDialogService.HasDialog())
{
    <EntityDialogComponent></EntityDialogComponent>
}


@code {

    protected override void OnInitialized()
    {
        entityDialogService.Subscribe(OnUpdate);
    }

    public void Dispose()
    {
        entityDialogService.Unsubscribe(OnUpdate);
    }

    void OnUpdate()
    {
        StateHasChanged();
    }

}