public MatrixTableMapper(string name, Func<ProcessingScope, IEnumerable<Tuple<object, object>>> selector, Func<string, IEnumerable<IFieldMapper>> fieldMappers,
            IEnumerable<IFieldMapper> commonFields = null)
        {
            Name = name;
            Selector = selector;            

            var splitter = new SimpleSplitter(new[] { "1", "2" }, o =>
            {
                var co = o as Tuple<object, object>;
                return new[] { co.Item1, co.Item2 };
            });



            TableDefinitions.Add(new TableDefinition(name)
            {
                FieldMappers = new[] { new SplittingFieldMapper(splitter, fieldMappers) }.Concat(commonFields.OrEmpty()).ToArray()
            });
        }
Exemplo n.º 2
0
        public MatrixTableMapper(string name, Func <ProcessingScope, IEnumerable <Tuple <object, object> > > selector, Func <string, IEnumerable <IFieldMapper> > fieldMappers,
                                 IEnumerable <IFieldMapper> commonFields = null)
        {
            Name     = name;
            Selector = selector;

            var splitter = new SimpleSplitter(new[] { "1", "2" }, o =>
            {
                var co = o as Tuple <object, object>;
                return(new[] { co.Item1, co.Item2 });
            });



            TableDefinitions.Add(new TableDefinition(name)
            {
                FieldMappers = new[] { new SplittingFieldMapper(splitter, fieldMappers) }.Concat(commonFields.OrEmpty()).ToArray()
            });
        }