Exemple #1
0
        private IQueryable <NotificationDelivery> GetFeedNotificationDeliveriesQueryable(string userId, params FeedNotificationTransport[] transports)
        {
            var transportsIds = new List <FeedNotificationTransport>(transports).Select(t => t.Id).ToList();
            var userCourses   = visitsRepo.GetUserCourses(userId);

            return(notificationsRepo.GetTransportsDeliveries(transportsIds, DateTime.MinValue)
                   .Where(d => userCourses.Contains(d.Notification.CourseId))
                   .Where(d => d.Notification.InitiatedById != userId));
        }
Exemple #2
0
        private IQueryable <NotificationDelivery> GetFeedNotificationDeliveriesQueryable(string userId, params FeedNotificationTransport[] transports)
        {
            var transportsIds = new List <FeedNotificationTransport>(transports).Select(t => t.Id).ToList();
            var userCourses   = visitsRepo.GetUserCourses(userId);

            return(notificationsRepo.GetTransportsDeliveriesQueryable(transportsIds, DateTime.MinValue)
                   .Where(d => userCourses.Contains(d.Notification.CourseId))
                   .Where(d => d.Notification.InitiatedById != userId)

                   /* TODO (andgein): bad code. we need to make these navigation properties loading via Notification' interface */
                   .Include(d => (d.Notification as AbstractCommentNotification).Comment)
                   .Include(d => (d.Notification as CourseExportedToStepikNotification).Process)
                   .Include(d => (d.Notification as ReceivedCommentToCodeReviewNotification).Comment)
                   .Include(d => (d.Notification as PassedManualExerciseCheckingNotification).Checking)
                   .Include(d => (d.Notification as ReceivedCommentToCodeReviewNotification).Comment)
                   .Include(d => (d.Notification as AbstractPackageNotification).CourseVersion));
        }