Example #1
0
 protected override void SetupJoinConditions()
 {
     //InnerJoin
     //    .Left("Id")
     //    .Right("Id");
     InnerJoin
     .Left("Vigencia")
     .Right("Year");
 }
Example #2
0
        private void runJoin(JoinSetting setting)
        {
            List <Row> left  = helper.DataTable2List(dictDataTable[setting.LeftDTName]);
            List <Row> right = helper.DataTable2List(dictDataTable[setting.RightDTName]);

            List <JoinCondition> joinConditions = new List <JoinCondition>();

            foreach (string[] item in setting.JoinConditions)
            {
                joinConditions.Add(new JoinCondition(item[0], item[1]));
            }

            List <Mapping> mappings = new List <Mapping>();

            foreach (string[] item in setting.Mappings)
            {
                mappings.Add(new Mapping(item[0], item[1], item[2], item[3]));
            }

            BaseJoin join;

            switch (setting.Type)
            {
            case "leftjoin":
                join = new LeftJoin();
                break;

            case "innerjoin":
                join = new InnerJoin();
                break;

            default:
                throw new NotImplementedException();
            }

            join.Left(new GenericEnumerableOperation(left))
            .Right(new GenericEnumerableOperation(right));

            join.JoinCondition(joinConditions);
            join.Mapping(mappings);

            join.PrepareForExecution(new SingleThreadedPipelineExecuter());
            IEnumerable <Row> result = join.Execute(null);
            List <Row>        items  = new List <Row>(result);

            DataTable dtResult = helper.List2DataTable(items);

            dictDataTable.Add(setting.OutputName, dtResult);
        }
Example #3
0
 protected override void SetupJoinConditions()
 {
     InnerJoin
     .Left("Id")
     .Right("Id");
 }