예제 #1
0
        public PostPart GetPositional(ThreadPart threadPart, bool includeInappropriate, VersionOptions versionOptions,
                                      ThreadPostPositional positional) {
            var query = GetParentQuery(threadPart, versionOptions);

            if (positional == ThreadPostPositional.First)
                query = query.OrderBy(o => o.PublishedUtc);

            if (positional == ThreadPostPositional.Latest)
                query = query.OrderByDescending(o => o.PublishedUtc );

            if (!includeInappropriate)
            {
                var postPart = query.Join<PostPartRecord>().Where(post => post.IsInappropriate == false);
                return postPart
                .ForPart<PostPart>()
                .Slice(1)
                .SingleOrDefault();
            }
            // else 

            return query.ForPart<PostPart>()
                .Slice(1)
                .SingleOrDefault();


        }
예제 #2
0
        public PostPart GetPositional(ThreadPart threadPart, VersionOptions versionOptions,
                                      ThreadPostPositional positional) {
            var query = GetParentQuery(threadPart, versionOptions);

            if (positional == ThreadPostPositional.First)
                query = query.OrderBy(o => o.PublishedUtc);

            if (positional == ThreadPostPositional.Latest)
                query = query.OrderByDescending(o => o.PublishedUtc);

            return query
                .ForPart<PostPart>()
                .Slice(1)
                .SingleOrDefault();
        }
예제 #3
0
        public PostPart GetPositional(ThreadPart threadPart, VersionOptions versionOptions,
                                      ThreadPostPositional positional)
        {
            var query = GetParentQuery(threadPart, versionOptions);

            if (positional == ThreadPostPositional.First)
            {
                query = query.OrderBy(o => o.PublishedUtc);
            }

            if (positional == ThreadPostPositional.Latest)
            {
                query = query.OrderByDescending(o => o.PublishedUtc);
            }

            return(query
                   .ForPart <PostPart>()
                   .Slice(1)
                   .SingleOrDefault());
        }
예제 #4
0
 public PostPart GetPositional(ThreadPart threadPart,
                               ThreadPostPositional positional)
 {
     return(GetPositional(threadPart, VersionOptions.Published, positional));
 }
예제 #5
0
 public PostPart GetPositional(ThreadPart threadPart, bool includeInappropriate,
     ThreadPostPositional positional) {
     return GetPositional(threadPart, includeInappropriate, VersionOptions.Published, positional);
 }
예제 #6
0
 public PostPart GetPositional(ThreadPart threadPart, 
     ThreadPostPositional positional) {
     return GetPositional(threadPart, VersionOptions.Published, positional);
 }