Ejemplo n.º 1
0
        private string GetSerializedName(Type klass, string fieldName)
        {
            var finalFieldName = _formatter.Format(fieldName);

            if (_provider.HasPropertySerializedName(klass, fieldName))
            {
                finalFieldName = _provider.GetPropertySerializedName(klass, fieldName);
            }

            return(finalFieldName);
        }
Ejemplo n.º 2
0
        public void Wrangle(int limit = int.MaxValue)
        {
            var stopWatch = Stopwatch.StartNew();

            _logger.LogInformation($"Starting Wrangling for recordType [{_recordConfiguration.RecordTypeName}]");

            // Simple lazy pipeline
            // Get source records, build target records, format the built targets, filter the final result, write the records...
            var countProcessed = _recordReader.GetRecords(limit)
                                 .Then(source => _recordBuilder.Build(source, _recordConfiguration))
                                 .Then(built => _fieldFormatter.Format(built, _recordConfiguration))
                                 .Then(format => _fieldFilterService.Filter(format, _recordConfiguration))
                                 .Then(filter => _recordWriter.Write(filter, _recordConfiguration))
                                 .Count();

            stopWatch.Stop();

            _logger.LogInformation($"Finished Wrangling, [{countProcessed}] target records successfully written, [{_recordReader.CountRead}] source reacords read, in [{stopWatch.Elapsed:mm\\:ss}]");
        }