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(); }
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(); }
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()); }
public PostPart GetPositional(ThreadPart threadPart, ThreadPostPositional positional) { return(GetPositional(threadPart, VersionOptions.Published, positional)); }
public PostPart GetPositional(ThreadPart threadPart, bool includeInappropriate, ThreadPostPositional positional) { return GetPositional(threadPart, includeInappropriate, VersionOptions.Published, positional); }
public PostPart GetPositional(ThreadPart threadPart, ThreadPostPositional positional) { return GetPositional(threadPart, VersionOptions.Published, positional); }