diff --git a/Src/Asp.Net/SqliteTest/SqliteTest.csproj b/Src/Asp.Net/SqliteTest/SqliteTest.csproj index 8495eff41..f2c5c76bc 100644 --- a/Src/Asp.Net/SqliteTest/SqliteTest.csproj +++ b/Src/Asp.Net/SqliteTest/SqliteTest.csproj @@ -102,6 +102,7 @@ + diff --git a/Src/Asp.Net/SqliteTest/UnitTest/Main.cs b/Src/Asp.Net/SqliteTest/UnitTest/Main.cs index 24b78c5b7..fd9cc5872 100644 --- a/Src/Asp.Net/SqliteTest/UnitTest/Main.cs +++ b/Src/Asp.Net/SqliteTest/UnitTest/Main.cs @@ -31,6 +31,7 @@ namespace OrmTest } public static void Init() { + USaveable.Init(); UnitSubToList.Init(); UnitByteArray.Init(); Unit01.Init(); diff --git a/Src/Asp.Net/SqliteTest/UnitTest/USaveable.cs b/Src/Asp.Net/SqliteTest/UnitTest/USaveable.cs new file mode 100644 index 000000000..d5b07990a --- /dev/null +++ b/Src/Asp.Net/SqliteTest/UnitTest/USaveable.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + internal class USaveable + { + public static void Init() + { + List(); + T(); + } + + private static void T() + { + var db = NewUnitTest.Db; + object o1 = new Order() { Id = 1, CreateTime = DateTime.Now, CustomId = 1, Name = "a", Price = 1 }; + db.StorageableByObject(o1).ExecuteCommand(); + + object o2 = new Order() { Id = 0, CreateTime = DateTime.Now, CustomId = 1, Name = "a", Price = 1 }; + db.StorageableByObject(o2).ExecuteCommand(); + + } + + private static void List() + { + var db = NewUnitTest.Db; + List o1 = new List() { new Order() { Id = 0, CreateTime = DateTime.Now, CustomId = 1, Name = "a", Price = 1 } }; + db.StorageableByObject(o1).ExecuteCommand(); + o1 = new List() { new Order() { Id = 1, CreateTime = DateTime.Now, CustomId = 1, Name = "a", Price = 1 } }; + db.StorageableByObject(o1).ExecuteCommand(); + + Console.WriteLine(""); + Console.WriteLine(""); + Console.WriteLine("insert update"); + + List o2 = new List() { new Order() { Id = 1, CreateTime = DateTime.Now, CustomId = 1, Name = "a", Price = 1 }, new Order() { Id = 0, CreateTime = DateTime.Now, CustomId = 1, Name = "a", Price = 1 } }; + var x = db.StorageableByObject(o2).ToStorage(); + x.AsInsertable.ExecuteCommand(); + x.AsUpdateable.ExecuteCommand(); + + object o = db.Queryable().ToList(); + db.StorageableByObject(o).ExecuteCommand(); + } + } +}