public async Task AddFeedNotificationTransportIfNeeded(string userId) { if (notificationsRepo.FindUsersNotificationTransport <FeedNotificationTransport>(userId, includeDisabled: true) != null) { return; } await notificationsRepo.AddNotificationTransport(new FeedNotificationTransport { UserId = userId, IsEnabled = true, }).ConfigureAwait(false); }
public FeedNotificationTransport GetCommentsFeedNotificationTransport() { var transport = notificationsRepo.FindUsersNotificationTransport <FeedNotificationTransport>(null); if (transport == null) { log.Error("Can't find common (comments) feed notification transport. You should create FeedNotificationTransport with userId = NULL"); throw new Exception("Can't find common (comments) feed notification transport"); } return(transport); }