Exemplo n.º 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();


        }
Exemplo n.º 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();
        }
Exemplo n.º 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());
        }
Exemplo n.º 4
0
 public PostPart GetPositional(ThreadPart threadPart,
                               ThreadPostPositional positional)
 {
     return(GetPositional(threadPart, VersionOptions.Published, positional));
 }
Exemplo n.º 5
0
 public PostPart GetPositional(ThreadPart threadPart, bool includeInappropriate,
     ThreadPostPositional positional) {
     return GetPositional(threadPart, includeInappropriate, VersionOptions.Published, positional);
 }
Exemplo n.º 6
0
 public PostPart GetPositional(ThreadPart threadPart, 
     ThreadPostPositional positional) {
     return GetPositional(threadPart, VersionOptions.Published, positional);
 }