예제 #1
0
 private void GenTestClass4TestData()
 {
     TestCreateTableTestClass4();
     var c1 = new TestClass4();
     c1.ID = "5555";
     c1.Age = 13;
     var c2 = new TestClass4();
     c2.ID = "5566";
     c2.Age = 12;
     var c3 = new TestClass4();
     c3.ID = "1234";
     c3.Age = 15;
     var sqliteDbc = new NLORMSQLiteDb(connectionString);
     sqliteDbc.Insert<TestClass4>(c1);
     sqliteDbc.Insert<TestClass4>(c2);
     sqliteDbc.Insert<TestClass4>(c3);
 }
예제 #2
0
 private void GenTestClass3TestData()
 {
     TestCreateTableTestClass3();
     var c1 = new TestClass3();
     c1.ID = "5555";
     c1.NAME = "N5555";
     var c2 = new TestClass3();
     c2.ID = "5566";
     c2.NAME = "N5555";
     var sqliteDbc = new NLORMSQLiteDb(connectionString);
     sqliteDbc.Insert<TestClass3>(c1);
     sqliteDbc.Insert<TestClass3>(c2);
 }
예제 #3
0
 public void TestSelectClass1WithCons()
 {
     TestCreateTable();
     var c1 = new TestClass();
     c1.ID = "5555";
     var c2 = new TestClass();
     c2.ID = "5566";
     var sqliteDbc = new NLORMSQLiteDb(connectionString);
     sqliteDbc.Insert<TestClass>(c1);
     sqliteDbc.Insert<TestClass>(c2);
     var result = sqliteDbc.FilterBy(FilterType.EQUAL_AND, new { ID = "5555" })
                           .Query<TestClass>();
     Assert.AreEqual(result.Count(), 1);
 }
예제 #4
0
 public void TestSelectClass1()
 {
     TestCreateTable();
     var c1 = new TestClass();
     c1.ID = "5555";
     var sqliteDbc = new NLORMSQLiteDb(connectionString);
     sqliteDbc.Insert<TestClass>(c1);
     var result = sqliteDbc.Query<TestClass>();
     Assert.AreEqual(result.Count(), 1);
 }
예제 #5
0
 public void TestInsertClassMutiData()
 {
     TestCreateTable();
     var sqliteDbc = new NLORMSQLiteDb(connectionString);
     for (int i = 0; i < 600; i++)
     {
         var c1 = new TestClass();
         c1.ID = "id"+i.ToString();
         sqliteDbc.Insert<TestClass>(c1);
     }
     var result = sqliteDbc.Query<TestClass>("SELECT * FROM  TestClass");
     Assert.AreEqual(result.Count(), 600);
 }
예제 #6
0
        public void TestInsertClass2()
        {
            TestCreateTableWithoutDef();
            var c1 = new TestClass2();
            c1.ID = "5555";
            var sqliteDbc = new NLORMSQLiteDb(connectionString);
            sqliteDbc.Insert<TestClass2>(c1);
            var d1 = new { a1 = 1 };

            var result = sqliteDbc.Query<TestClass2>("SELECT * FROM  TestClass2");
            Assert.AreEqual(result.Count(), 1);
        }