using Infrastructure.Events; using Infrastructure.Extensions; using Microsoft.AspNetCore.SignalR; using Platform.Services; using System; using System.Threading.Tasks; namespace Platform.EventHandlers { public class BaseEventHandler { private readonly IHubContext _hub; public BaseEventHandler(IHubContext hub) { this._hub = hub; } public void Notify(BaseEvent message) { Task.Run(() => { try { _hub.ServerToClient($"{typeof(T).Name}{message.Arg}", message.Data, "page", null); } catch (Exception ex) { ex.PrintStack(); } }); } } }