public static List <BatchConfiguration> Get(string serverId, string serverName, int wsdlPort)
        {
            Queries.QueryServiceClient queryClient = EndPoint.GetQueryClient(serverName, wsdlPort);

            Queries.QueryMetadata query = BatchConfiguration.Query(serverId);

            Queries.Paging paging = new Queries.PositionBasedPaging();
            (paging as Queries.PositionBasedPaging).StartingPosition       = 1;
            (paging as Queries.PositionBasedPaging).NumberOfRecordsToFetch = 100;

            Queries.ExecuteQueryRequest request = new Queries.ExecuteQueryRequest(query, paging);
            DataSet data = queryClient.ExecuteQuery(query, ref paging);

            List <BatchConfiguration> configs = null;

            configs = BatchConfiguration.RowsToConfigs(data);

            return(configs);
        }
        public static async Task <List <BatchConfiguration> > GetAsync(string serverId, string serverName, int wsdlPort)
        {
            Queries.QueryServiceClient queryClient = EndPoint.GetQueryClient(serverName, wsdlPort);

            Queries.QueryMetadata query = BatchConfiguration.Query(serverId);

            Queries.Paging paging = new Queries.PositionBasedPaging();
            (paging as Queries.PositionBasedPaging).StartingPosition       = 1;
            (paging as Queries.PositionBasedPaging).NumberOfRecordsToFetch = 100;

            Queries.ExecuteQueryRequest         request   = new Queries.ExecuteQueryRequest(query, paging);
            Task <Queries.ExecuteQueryResponse> queryTask = queryClient.ExecuteQueryAsync(request);

            await queryTask;

            List <BatchConfiguration> configs = null;

            if (queryTask.Result != null)
            {
                configs = BatchConfiguration.RowsToConfigs(queryTask.Result.ExecuteQueryResult);
            }

            return(configs);
        }