public async Task BanAsync(string userId, string reason) { await _userService.BanAsync(new User { Id = userId }, reason); await _notificationService.NotifyAsync(userId, "Ban", new BanNotificationSource() { Reason = reason }); await _hubContext.Clients.Clients(_userConnectionService.GetUserConnections(userId)).SendAsync("ban", reason); }
public async Task NotifyAsync(string userId, INotificationSource sourse, string type) => await NotifyAsync(_userConnectionService.GetUserConnections(userId), type, sourse);