예제 #1
0
        public IEnumerable <List <KeyValuePair <string, string> > > GetPersonKeys(long batches, int batchSize)
        {
            var batch = new List <KeyValuePair <string, string> >(batchSize);

            foreach (var reader in dbSource.GetPersonKeys(Settings.Current.Building.BatchScript, batches, batchSize))
            {
                if (batch.Count == batchSize)
                {
                    yield return(batch);

                    batch.Clear();
                }

                var id     = reader[0].ToString().Trim();
                var source = reader[1].ToString().Trim();

                batch.Add(new KeyValuePair <string, string>(id, source));
            }

            yield return(batch);
        }
예제 #2
0
        public IEnumerable <List <KeyValuePair <string, string> > > GetPersonKeys(long batches, int batchSize)
        {
            var batch = new List <KeyValuePair <string, string> >(batchSize);

            var query = GetSqlHelper.GetSql(Settings.Current.Building.SourceEngine.Database, Settings.Current.Building.BatchScript, Settings.Current.Building.SourceSchemaName);

            foreach (var reader in dbSource.GetPersonKeys(query, batches, batchSize))
            {
                if (batch.Count == batchSize)
                {
                    yield return(batch);

                    batch.Clear();
                }

                var id     = reader[0].ToString().Trim();
                var source = reader[1].ToString().Trim(); // ? replace to reader[1].ToString(), without Trim()

                batch.Add(new KeyValuePair <string, string>(id, source));
            }

            yield return(batch);
        }
예제 #3
0
        public IEnumerable <List <KeyValuePair <string, string> > > GetPersonKeys(long batches, int batchSize)
        {
            var batch = new List <KeyValuePair <string, string> >(batchSize);

            var query = GetSqlHelper.GetSql(_settings.SourceEngine.Database, _settings.BatchScript, _settings.ConversionSettings.SourceSchema);

            foreach (var reader in _dbSource.GetPersonKeys(query, batches, batchSize))
            {
                if (batch.Count == batchSize)
                {
                    yield return(batch);

                    batch.Clear();
                }

                var id     = reader[0].ToString().Trim();
                var source = reader[1].ToString().Trim();

                batch.Add(new KeyValuePair <string, string>(id, source));
            }

            yield return(batch);
        }