示例#1
0
        protected InsertableProvider <T> CreateInsertable <T>(T[] insertObjs) where T : class, new()
        {
            var reval      = InstanceFactory.GetInsertableProvider <T>(this.CurrentConnectionConfig);
            var sqlBuilder = InstanceFactory.GetSqlbuilder(this.CurrentConnectionConfig);;

            reval.Context                              = this.Context;
            reval.EntityInfo                           = this.Context.EntityMaintenance.GetEntityInfo <T>();
            reval.SqlBuilder                           = sqlBuilder;
            reval.InsertObjs                           = insertObjs;
            sqlBuilder.InsertBuilder                   = reval.InsertBuilder = InstanceFactory.GetInsertBuilder(this.CurrentConnectionConfig);
            sqlBuilder.InsertBuilder.Builder           = sqlBuilder;
            sqlBuilder.InsertBuilder.LambdaExpressions = InstanceFactory.GetLambdaExpressions(this.CurrentConnectionConfig);
            sqlBuilder.Context                         = reval.SqlBuilder.InsertBuilder.Context = this.Context;
            reval.Init();
            return(reval);
        }