1234567891011121314151617181920212223242526 |
- using Luticate2.Utils.Hubs;
- using Microsoft.AspNetCore.SignalR;
- using Microsoft.AspNetCore.SignalR.Infrastructure;
-
- namespace Luticate2.Utils.Business
- {
- public class LuNotificationsBusiness
- {
- private readonly IHubContext _hubContext;
-
- public LuNotificationsBusiness(IConnectionManager connectionManager)
- {
- _hubContext = connectionManager.GetHubContext<LuNotificationsHub>();
- }
-
- public void Notify(string eventName, string entityType, object entity)
- {
- _hubContext.Clients.All.notify(eventName, entityType, entity);
- }
-
- public void NotifyUpdate(string eventName, string entityType, object entity)
- {
- Notify("update", entityType, entity);
- }
- }
- }
|