public Task SendNotificationMessageAsync(Guid userId, BaseNotificationMessage message) { return(_notificationHubContext .Clients .User(userId.ToString()) .SendAsync(NotificationMethodName, message)); }
public Task SendNotificationMessageAsync(ClaimsPrincipal user, BaseNotificationMessage message) { var userId = user.FindFirst(ClaimTypes.NameIdentifier); if (userId == null || string.IsNullOrEmpty(userId.Value)) { throw new UserNotLoggedInException(); } return(SendNotificationMessageAsync(Guid.Parse(userId.Value), message)); }