Ejemplo n.º 1
0
 public virtual void GetCommentsByPost(IEnumerable<int> postIds, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, CommentsByPostOptions options)
 {
     MakeRequest<CommentResponse>("posts", new string[] { postIds.Vectorize(), "comments" }, new
     {
         key = apiKey,
         page = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         sort = options.SortBy.ToString().ToLower(),
         order = GetSortDirection(options.SortDirection),
     }, (items) => onSuccess(new PagedList<Comment>(items.Comments, items)), onError);
 }
Ejemplo n.º 2
0
 public virtual void GetAnswerComments(IEnumerable<int> answerIds, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, CommentsByPostOptions options)
 {
     MakeRequest<CommentResponse>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
     {
         key = apiKey,
         page = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         sort = options.SortBy.ToString().ToLower(),
         order = GetSortDirection(options.SortDirection),
         min = options.Min ?? null,
         max = options.Max ?? null
     }, response => onSuccess(new PagedList<Comment>(response.Comments, response)), onError);
 }
Ejemplo n.º 3
0
 public virtual void GetAnswerComments(int answerId, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, CommentsByPostOptions options)
 {
     GetAnswerComments(answerId.ToArray(), onSuccess, onError, options);
 }
Ejemplo n.º 4
0
 public virtual void GetAnswerComments(IEnumerable <int> answerIds, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, CommentsByPostOptions options)
 {
     MakeRequest <CommentResponse>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
     {
         key      = apiKey,
         page     = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate   = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         sort     = options.SortBy.ToString().ToLower(),
         order    = GetSortDirection(options.SortDirection),
         min      = options.Min ?? null,
         max      = options.Max ?? null
     }, response => onSuccess(new PagedList <Comment>(response.Comments, response)), onError);
 }
Ejemplo n.º 5
0
 public virtual void GetAnswerComments(int answerId, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, CommentsByPostOptions options)
 {
     GetAnswerComments(answerId.ToArray(), onSuccess, onError, options);
 }
Ejemplo n.º 6
0
 public virtual void GetCommentsByPost(IEnumerable <int> postIds, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, CommentsByPostOptions options)
 {
     MakeRequest <CommentResponse>("posts", new string[] { postIds.Vectorize(), "comments" }, new
     {
         key      = apiKey,
         page     = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate   = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         sort     = options.SortBy.ToString().ToLower(),
         order    = GetSortDirection(options.SortDirection),
     }, (items) => onSuccess(new PagedList <Comment>(items.Comments, items)), onError);
 }
Ejemplo n.º 7
0
 public virtual IPagedList <Comment> GetAnswerComments(int answerId, CommentsByPostOptions options)
 {
     return(GetAnswerComments(answerId.ToArray(), options));
 }
Ejemplo n.º 8
0
        public virtual IPagedList <Comment> GetCommentsByPost(IEnumerable <int> postIds, CommentsByPostOptions options)
        {
            var response = MakeRequest <CommentResponse>("posts", new string[] { postIds.Vectorize(), "comments" }, new
            {
                key      = apiKey,
                page     = options.Page ?? null,
                pagesize = options.PageSize ?? null,
                fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                todate   = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
                sort     = options.SortBy.ToString().ToLower(),
                order    = GetSortDirection(options.SortDirection),
            });

            return(new PagedList <Comment>(response.Comments, response));
        }
Ejemplo n.º 9
0
 public virtual IPagedList <Comment> GetCommentsByPost(int postId, CommentsByPostOptions options)
 {
     return(GetCommentsByPost(postId.ToArray(), options));
 }