Beispiel #1
0
        public void 同时创建两个对象_不同一数据库内()
        {
            Log1Services Logbll = new Log1Services();

            UserEntity model = new UserEntity();
            model.UserName = "******" + rd.Next(100, 10000);
            model.Num = rd.Next(100, 10000);
            model.PostTime = DateTime.Now;
            ubll.Insert(model);

            LogEntity log = new LogEntity();
            log.UserName1 = "Name" + rd.Next(100, 10000);
            log.Num1 = rd.Next(100, 10000);
            log.PostTime1 = DateTime.Now;
            Logbll.Insert(log);

            model.UserName = "******" + rd.Next(100, 10000);
            model.Num = rd.Next(100, 10000);
            model.PostTime = DateTime.Now;
            ubll.Insert(model);
        }
Beispiel #2
0
 public void 添加()
 {
     UserEntity model = new UserEntity();
     model.UserName = "******" + rd.Next(100, 10000);
     model.Num = rd.Next(100, 10000);
     model.PostTime = DateTime.Now;
     ubll.Insert(model);
 }
Beispiel #3
0
 public void 批量添加()
 {
     List<UserEntity> Data = new List<UserEntity>();
     for (int i = 0; i < 1000000; i++)
     {
         UserEntity model = new UserEntity();
         model.UserName = "******" + rd.Next(100, 10000);
         model.Num = rd.Next(100, 10000);
         model.PostTime = DateTime.Now;
         Data.Add(model);
     }
     ubll.InsertBatch(Data);
 }