private static ServiceOperationResultOfPagedListResultOfArrayOfUserDataVUqw3SxCVUqw3SxC getUsers(
     string authToken, string provider, int pageNumber, int pageSize,
     string sortField, bool sortAscending, string filterField, string filterValue, int period,
     string dateFieldName)
 {
     var service = new UserManagementServiceClient();
     var result = service.GetUsers(authToken, provider, pageNumber, pageSize, sortField, sortAscending,
         filterField, filterValue);
     return result.CallSuccess ? result : null;
 }
        /// <summary>
        /// Get a paged, sorted, and filtered list of UserData objects.
        /// </summary>
        /// <param name="authenticationToken">Encrypted forms auth token identifying the requesting user.</param>
        /// <param name="pageNumber">The index of the first page to begin retrieving results from. Specifying 0 disables pagination.</param>
        /// <param name="pageSize">The number of results to display on a page. Specifying 0 disables pagination.</param>
        /// <param name="sortField">The field used when sorting results. Specifying null disables sorting.</param>
        /// <param name="sortAscending">The sort direction.</param>
        /// <param name="filterField">The field to use when filtering results. Specifying null disables filtering.</param>
        /// <param name="filterValue">Filter criteria. Specifying null disables filtering.</param>
        /// <returns>List of user data matching filters (or all identities if filter values are null).</returns>
        private static IEnumerable<UserData> GetUsers(
                                        string authenticationToken,
                                        int pageNumber = 0,
                                        int pageSize = 0,
                                        string sortField = null,
                                        bool sortAscending = true,
                                        string filterField = null,
                                        string filterValue = null)
        {
            /*
             * If you are unable to reference System.Service make sure that the project is configured to
             * use the full 4.0 framework and not the client profile.
             */
            var proxy = new UserManagementServiceClient();
            var result = proxy.GetUsers(
                                                                                    authenticationToken,
                                                                                    null,
                                                                                    pageNumber,
                                                                                    pageSize,
                                                                                    sortField,
                                                                                    sortAscending,
                                                                                    filterField,
                                                                                    filterValue);

            // Handle exceptions
            if (!result.CallSuccess)
            {
                Console.WriteLine(result.FailureMessage);
                return null;
            }

            return result.ResultData.ResultPage;
        }