public async Task NotifyAsync(NewPostDto postModel, NewlyCreatedPostDto createdPost, UserAndOrganizationHubDto userHubDto) { await _postNotificationService.NotifyAboutNewPostAsync(createdPost); var membersToNotify = await _wallService.GetWallMembersIdsAsync(postModel.WallId, postModel); await NotificationHub.SendWallNotificationAsync(postModel.WallId, membersToNotify, createdPost.WallType, userHubDto); }
public async Task NotifyAsync(NewlyCreatedPostDto createdPost, UserAndOrganizationHubDto userAndOrganizationHubDto) { await _postNotificationService.NotifyAboutNewPostAsync(createdPost); var membersToNotify = (await _userService.GetWallUserAppNotificationEnabledIdsAsync(createdPost.User.UserId, createdPost.WallId)).ToList(); var notificationDto = await _notificationService.CreateForPostAsync(userAndOrganizationHubDto, createdPost, createdPost.WallId, membersToNotify); var notificationViewModel = _mapper.Map <NotificationViewModel>(notificationDto); await NotificationHub.SendNotificationToParticularUsersAsync(notificationViewModel, userAndOrganizationHubDto, membersToNotify); await NotificationHub.SendWallNotificationAsync(createdPost.WallId, membersToNotify, createdPost.WallType, userAndOrganizationHubDto); }