選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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. }