コード例 #1
0
        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);
        }
コード例 #2
0
 public async Task NotifyAsync(string userId, INotificationSource sourse, string type)
 => await NotifyAsync(_userConnectionService.GetUserConnections(userId), type, sourse);