Beispiel #1
0
        /// <summary>
        /// Another query execution, able to designate the number of items you want
        /// </summary>
        /// <param name="numberOfItemsToReturn"></param>
        /// <returns></returns>
        public IEnumerable <FeedItem> Execute(int?numberOfItemsToReturn)
        {
            var query = new OSBLEPlus.Services.Controllers.FeedController().Get(
                StartDate     // 1
                , EndDate     // 2
                , MinLogId
                , MaxLogId
                , EventIds         //.Select(eid => (int)eid).ToList() // 3
                , GetEventFilter() //_eventSelectors.Select(e => (int)e) // 4
                , CourseFilter != null && CourseFilter.ID > 0 ? CourseFilter.ID : 0
                , CourseRoleFilter == null ? (int?)null : CourseRoleFilter.ID
                , CommentFilter == String.Empty ? String.Empty : "%" + CommentFilter + "%"
                , SubscriptionSubjects.Select(s => s.ID).ToList()
                , numberOfItemsToReturn
                );

            MinLogId = MaxLogId = null;

            return(query.GetAwaiter().GetResult());
        }
Beispiel #2
0
        /// <summary>
        /// For use with user's profile, returns all FeedItems of the user's ID given
        /// Will still need to be converted to AggregateFeedItems
        /// </summary>
        public static IEnumerable <FeedItem> ProfileQuery(int courseUserId)
        {
            List <int> eventIds = DBHelper.GetUserFeedFromId(courseUserId).ToList();

            var query = new OSBLEPlus.Services.Controllers.FeedController().Get(
                new DateTime(2010, 1, 1), // start date
                DateTime.Now.AddDays(3),  // end date
                null,                     // min log id
                null,                     // max log id
                eventIds,                 // eventIds
                null,                     // Event Filter
                null,                     // Course Filter
                null,                     // Role Filter
                String.Empty,             // Comment Filter
                new List <int>()
            {
                1
            },                              // Subscriptions
                eventIds.Count              // number to return
                );

            return(query.GetAwaiter().GetResult());
        }