private void Announcement_ChurchAnnouncementPublished(object sender, NotificationEventArgs e) { var notification = notificationService.Create(e.Notification); var favoritesService = new FavoritesService(); var followers = favoritesService.GetChurchFollowers(e.Id); foreach (Tuple <ChurchInfo, User> follower in followers) { notificationService.CreateUserNotification(notification.Id, follower.Item2.Id); } }
private void Review_ChurchReviewPublished(object sender, NotificationEventArgs e) { var notification = notificationService.Create(e.Notification); var favoritesService = new FavoritesService(); // Get the list of users who 'subscribe' to the church that this review was published on. var followers = favoritesService.GetChurchFollowers(e.Id); // Create a notifacation instance for every one of the 'subscribers' foreach (Tuple <ChurchInfo, User> follower in followers) { notificationService.CreateUserNotification(notification.Id, follower.Item2.Id); } }