Example #1
0
        private void readTargetFromLine(FlatFileRequest <T> request, FlatFileRequestData data, string line, BindingContext context)
        {
            data.ReadLine(line);

            var target = request.Finder(data);

            _binder.Bind(typeof(T), target, context);

            request.Callback(target);
        }
Example #2
0
        private void processData(FlatFileRequest <T> request, StreamReader reader, string headers)
        {
            var data = new FlatFileRequestData(request.Concatenator, headers);

            _aliases.Each((header, alias) => data.Alias(header, alias));

            var context = new BindingContext(data, _services);

            string line;

            while ((line = reader.ReadLine()) != null)
            {
                readTargetFromLine(request, data, line, context);
            }
        }
 public void SetUp()
 {
     request = new FlatFileRequestData("|", "a|b|c|d");
 }