using MediatR; using Microsoft.AspNetCore.SignalR; using Sledgemapper.Api.Notifications; using Sledgemapper.Clients; using System.Threading; using System.Threading.Tasks; using Sledgemapper.Api.Hubs; namespace Sledgemapper.Api.Handlers { public class SendNewLineMessage : INotificationHandler { private readonly IHubContext _hub; public SendNewLineMessage(IHubContext hub) => _hub = hub; public async Task Handle(NewLineNotification notification, CancellationToken cancellationToken) { await _hub.Clients.Groups(notification.Session.SessionName).NewLine(notification.Line); } } }