You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NotificationsBusiness.cs 770B

1234567891011121314151617181920212223242526
  1. using Luticate2.Utils.Hubs;
  2. using Microsoft.AspNetCore.SignalR;
  3. using Microsoft.AspNetCore.SignalR.Infrastructure;
  4. namespace Luticate2.Utils.Business
  5. {
  6. public class LuNotificationsBusiness
  7. {
  8. private readonly IHubContext _hubContext;
  9. public LuNotificationsBusiness(IConnectionManager connectionManager)
  10. {
  11. _hubContext = connectionManager.GetHubContext<LuNotificationsHub>();
  12. }
  13. public void Notify(string eventName, string entityType, object entity)
  14. {
  15. _hubContext.Clients.All.notify(eventName, entityType, entity);
  16. }
  17. public void NotifyUpdate(string eventName, string entityType, object entity)
  18. {
  19. Notify("update", entityType, entity);
  20. }
  21. }
  22. }