Do these things.
1.Create a wrapper class like this
public class WrappedDTOUserComment
{
public IEnumerable<DTOUserComment> Comments { get; set; }
public int CommentCount { get; set; }
}
2.Then change the method like this
public WrappedDTOUserComment GetCommentsForVideoPage(
int videoID, string pageSize,
string pageNumber)
{
int? pageSizeInt = pageSize.ParseNullableInt();
int? pageNumberInt = pageNumber.ParseNullableInt();
WrappedDTOUserComment data = null;
IEnumerable<DTOUserComment> results = null;
// TODO
int resultCount;
try
{
results = searcher.GetCommentsForVideoPage(**out resultCount,** videoID, pageSizeInt, pageNumberInt);
}
catch (UnauthorizedAccessException ex)
{
Logger.Write(ex);
}
catch (Exception ex)
{
Logger.Write(ex);
}
data.Comments = results;
data.CommentCount = resultCount;
return data;
}
3.The interface will be
[OperationContract(IsOneWay = false)]
[WebInvoke
(Method = "GET",
ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "xml/getcommentsforvideopage?vid={videoID}&psize={pageSize}&pnum={pageNumber}")]
WrappedDTOUserComment GetCommentsForVideoPage(
// out int resultCount,
int videoID, string pageSize,
string pageNumber);