예제 #1
0
        public void TestInsert()
        {
            var test = new Entity.dapper_test.Test();

            test.id   = 1;
            test.name = "dapper_t4_insert_test_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            test.Time = DateTime.Now;
            var count = test.Insert();

            Assert.AreEqual(count, 1);
        }
예제 #2
0
        public void TestInsertList()
        {
            var list = new List <Entity.dapper_test.Test>();

            for (var i = 0; i < 5; i++)
            {
                var test = new Entity.dapper_test.Test();
                test.id   = 1;
                test.name = "dapper_t4_insert_test_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                test.Time = DateTime.Now;
                list.Add(test);
            }
            var row = list.Insert();

            Assert.AreEqual(list.Count, row);
        }