Example #1
0
 protected SelectJoinBase(DataContext context, LambdaExpression expression, List <IJoinModel> models, List <IMap> maps)
 {
     _models     = models;
     _context    = context;
     _mapping    = DynamicMultiDataMapping.CreateDynamicMultiDataMapping(typeof(K), _models);
     _expression = expression;
     _maps       = maps;
 }
        public static DynamicMultiDataMapping CreateDynamicMultiDataMapping(Type type, List <IJoinModel> models)
        {
            Tuple <string, IJoinTableMapping> [] array = new Tuple <string, IJoinTableMapping> [models.Count];
            for (int i = 0; i < models.Count; i++)
            {
                IJoinModel model = models [i];
                Tuple <string, IJoinTableMapping> tuple = new Tuple <string, IJoinTableMapping> (model.AliasTableName, model.JoinMapping);
                array [i] = tuple;
            }
            DynamicMultiDataMapping mapping = new DynamicMultiDataMapping(type, array);

            return(mapping);
        }