Пример #1
0
        protected void WhenProcessingADenormalizedFileUsingProcessingRules()
        {
            var processorA = new Processor <DenormalizedEntity, Dto1>(
                new ProcessorConfiguration <DenormalizedEntity, Dto1>(_specProvider,
                                                                      new SpecProvider <IEnumerable <Dto1> >()),
                new ProcessorEngine <DenormalizedEntity>())
            {
                BeginProcessingItem = (dtoIn, dtoOut) =>
                {
                    dtoOut.Source  = dtoIn;
                    dtoOut.Contact = new Contact
                    {
                        Id          = 0,
                        Name        = dtoIn.ContactName,
                        Description = dtoIn.ContactDescription
                    };
                }
            };

            _processorA = processorA;

            // process from csv
            var enumeration = new CsvProcessorReader <DenormalizedEntity>().Read(DataFileToCreate);

            _resultA = processorA.Process(enumeration, _batchProcess);

            _repository.Save(_resultA);

            // todo: save to data store
        }
Пример #2
0
        protected void WhenProcessingADenormalizedFileUsingProcessingRules()
        {
            var processorA = _container.Resolve <Processor <DenormalizedEntity, Dto1> >();

            processorA.BeginProcessingItem = (dtoIn, dtoOut) =>
            {
                dtoOut.Source  = dtoIn;
                dtoOut.Contact = new Contact
                {
                    Id          = 0,
                    Name        = dtoIn.ContactName,
                    Description = dtoIn.ContactDescription
                };
            };

            _processorA = processorA;

            // process from csv
            var enumeration = new CsvProcessorReader <DenormalizedEntity>().Read(DataFileToCreate);

            _resultA = processorA.Process(enumeration, _batchProcess);

            _repository.Save(_resultA);
        }