Пример #1
0
        public HttpResponseMessage Get(int pageNumber = 1, int pageSize = 5, string queryString = null)
        {
            List <User> userData = UserProfileServices.Get(pageNumber, pageSize, queryString);

            PagedItemsResponse <User> response = new PagedItemsResponse <User>();

            response.Items = userData;

            response.PageNumber = pageNumber;

            response.PageSize = pageSize;

            response.TotalItems = UserProfileServices.GetPagedUsers(); // change to count all users

            response.QueryString = queryString;

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
        public HttpResponseMessage GetThreadsByGroupId(int groupId, int pageNumber = 1, int pageSize = 10)
        {
            //string senderId = UserService.GetCurrentUserId();

            List <MessageThreads> threadInfo = MessageThreadsService.GetThreadsByGroupId(groupId, pageNumber, pageSize);

            //for pagination
            PagedItemsResponse <MessageThreads> response = new PagedItemsResponse <MessageThreads>();

            response.Items = threadInfo;

            response.PageNumber = pageNumber;

            response.PageSize = pageSize;

            response.TotalItems = MessageThreadsService.GetPageThreads(groupId);


            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }