public static List <ObjectComment> GetCommentsPosted(Guid userId, DateTime?createdFrom, DateTime?createdTo, string text, Guid?objectId, string username, string generalSearchParam, int?pageNum, int?pageSize, string sortAttr, string sortDir, out int numberItems) { List <ObjectComment> commentList = new List <ObjectComment>(); int?refNumberItems = null; CSBooster_DataContext cdc = new CSBooster_DataContext(Helper.GetSiemeConnectionString()); var commentResults = cdc.hisp_Comments_GetCommentsPosted(userId, createdFrom, createdTo, "%" + text + "%", objectId, "%" + username + "%", "%" + generalSearchParam + "%", pageNum, pageSize, sortAttr, sortDir, ref refNumberItems); foreach (CommentResult commentResult in commentResults) { ObjectComment comment = new ObjectComment(); ObjectComment.FillComment(comment, commentResult); commentList.Add(comment); } numberItems = refNumberItems.Value; return(commentList); }