Ejemplo n.º 1
0
        private async Task <CommentSegment> GetCommentSegment(int submissionID, int?parentID, int startingIndex, CommentSortAlgorithm sort)
        {
            var q       = new QueryCommentSegment(submissionID, parentID, startingIndex, sort).SetUserContext(User);
            var results = await q.ExecuteAsync();

            return(results);
        }
Ejemplo n.º 2
0
        private async Task <CommentSegment> GetCommentSegment(int submissionID, int?parentID, int startingIndex, string sort)
        {
            //attempt to parse sort
            var sortAlg = CommentSortAlgorithm.Top;

            if (!Enum.TryParse(sort, true, out sortAlg))
            {
                sortAlg = CommentSortAlgorithm.Top;
            }

            var q       = new QueryCommentSegment(submissionID, parentID, startingIndex, sortAlg);
            var results = await q.ExecuteAsync();

            return(results);
        }