using DbFirst.API.Hubs;
using Microsoft.AspNetCore.SignalR;

namespace DbFirst.API.Dashboards;

public class DashboardChangeNotifier : IDashboardChangeNotifier
{
    private readonly IHubContext<DashboardsHub> _hubContext;

    public DashboardChangeNotifier(IHubContext<DashboardsHub> hubContext)
    {
        _hubContext = hubContext;
    }

    public void NotifyChanged()
    {
        _ = _hubContext.Clients.All.SendAsync("DashboardsChanged");
    }
}
