public HttpResponseMessage GetContentComments(int siteId, int contextId, int contextContentId) { ContentClientProcessor.UserContext.SiteId = siteId; ContentCommentDataModel contentCommentsData = ContentClientProcessor.GetContentComments((ContextEnum)contextId, contextContentId); return(Request.CreateResponse(HttpStatusCode.OK, contentCommentsData)); }
/// <summary> /// GetContentComments /// </summary> /// <param name="contextId"></param> /// <returns></returns> public ContentCommentDataModel GetContentComments(ContextEnum context, int contextContentId) { ContentCommentDataModel contentCommentsData = null; ContentCommentRequestDC contentCommentsRequest = new ContentCommentRequestDC(); contentCommentsRequest.ContextId = (int)context; contentCommentsRequest.ContextContentId = contextContentId; ServiceResponse <ContentCommentDataDC> contentCommentsResponse = _contentProxy.Execute(opt => opt.GetContentComments(contentCommentsRequest)); if (contentCommentsResponse.Status == ResponseStatus.Success) { contentCommentsData = Mapper.Map <ContentCommentDataDC, ContentCommentDataModel>(contentCommentsResponse.Result); contentCommentsData.ContentComments = new List <ContentCommentModel>(); AddChildContentComments(contentCommentsData.ContentComments, contentCommentsResponse.Result.ContentComments, 0); } else { HandleError(contentCommentsResponse.Status, contentCommentsResponse.ResponseMessage); } return(contentCommentsData); }