示例#1
0
        public void 批量插入测试()
        {
            //return;

            var list3old = LockDapperUtilsqlite <LockPers_> .Cud.GetAll();

            List <LockPers_ms_> list3new = new List <LockPers_ms_>();

            foreach (var item in list3old)
            {
                //var model = CopyModelHelper.MapperWrite<LockPers_ms, LockPers>(item);

                list3new.Add(CopyModelHelper.Mapper <LockPers_ms_, LockPers_>(item));
            }
            var efrow = LockDapperUtilmssql <LockPers_ms_> .Cud.InserList(list3new);

            Console.WriteLine("影响行数-" + efrow);

            return;

            var list2old = LockDapperUtilsqlite <SynNote> .Cud.GetAll();

            foreach (var item in list2old)
            {
                var model = CopyModelHelper.Mapper <SynNote_ms, SynNote>(item);
                LockDapperUtilmssql <SynNote_ms> .Cud.Insert(model);

                //newlist.Add ( );
            }

            var list1old = LockDapperUtilsqlite <Users> .Cud.GetAll();

            foreach (var item in list1old)
            {
                var model = CopyModelHelper.Mapper <Users_ms, Users>(item);
                LockDapperUtilmssql <Users_ms> .Cud.Insert(model);
            }
        }
示例#2
0
        public void 批量插入测试()
        {
            //return;  // sqlite 读取 批量插入到 mssql


            var list3old = DBSqliteFuncs.New.GetAll <LockPers_>();
            List <LockPers_ms_> list3new = new List <LockPers_ms_>();

            foreach (var item in list3old)
            {
                //var model = CopyModelHelper.MapperWrite<LockPers_ms, LockPers>(item);

                list3new.Add(CopyModelHelper.Mapper <LockPers_ms_, LockPers_>(item));
            }
            var efrow = DapperFuncMs.New.InserList <LockPers_ms_>(list3new);

            Console.WriteLine("影响行数-" + efrow);

            return;

            var list2old = DBSqliteFuncs.New.GetAll <SynNote>();

            foreach (var item in list2old)
            {
                var model = CopyModelHelper.Mapper <SynNote_ms, SynNote>(item);
                DapperFuncMs.New.Insert <SynNote_ms>(model);
                //newlist.Add ( );
            }

            var list1old = DBSqliteFuncs.New.GetAll <Users>();

            foreach (var item in list1old)
            {
                var model = CopyModelHelper.Mapper <Users_ms, Users>(item);
                DapperFuncMs.New.Insert <Users_ms>(model);
            }
        }