diff --git a/Src/Asp.Net/MySqlTest/MySqlTest.csproj b/Src/Asp.Net/MySqlTest/MySqlTest.csproj index 8fec8d5a6..165f2730b 100644 --- a/Src/Asp.Net/MySqlTest/MySqlTest.csproj +++ b/Src/Asp.Net/MySqlTest/MySqlTest.csproj @@ -86,6 +86,7 @@ + diff --git a/Src/Asp.Net/MySqlTest/UnitTest/Main.cs b/Src/Asp.Net/MySqlTest/UnitTest/Main.cs index db78ec7c7..fbd49ada5 100644 --- a/Src/Asp.Net/MySqlTest/UnitTest/Main.cs +++ b/Src/Asp.Net/MySqlTest/UnitTest/Main.cs @@ -31,6 +31,7 @@ namespace OrmTest } public static void Init() { + UCustom07.Init(); UnitTestReturnPkList.Init(); UnitSameKeyBug.Init(); UOneManyMany.init(); diff --git a/Src/Asp.Net/MySqlTest/UnitTest/UCustom07.cs b/Src/Asp.Net/MySqlTest/UnitTest/UCustom07.cs new file mode 100644 index 000000000..89d75fb08 --- /dev/null +++ b/Src/Asp.Net/MySqlTest/UnitTest/UCustom07.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + public class UCustom07 + { + public static void Init() + { + var db = NewUnitTest.Db; + var x=db.Deleteable(new Date1() { dateTime = DateTime.Now,name="a" }).ToSql(); + if (x.Key.Contains("//") || x.Key.Contains("\\")) { throw new Exception("unit error"); } + var x2 = db.Deleteable(new Date2() { dateTime = DateTime.Now, name = "a" }).ToSql(); + if (x2.Key.Contains("//") || x.Key.Contains("\\")) { throw new Exception("unit error"); } + db.CodeFirst.InitTables(); + db.Deleteable(new Date1() { dateTime = DateTime.Now, name = "a" }).ExecuteCommand(); + db.Deleteable(new Date2() { dateTime = DateTime.Now, name = "a" }).ExecuteCommand(); + db.DbMaintenance.DropTable("Date1"); + db.DbMaintenance.DropTable("Date2"); + } + } + public class Date2 + { + [SqlSugar.SugarColumn(IsPrimaryKey = true)] + public DateTime dateTime { get; set; } + + public string name { get; set; } + } + public class Date1 + { + [SqlSugar.SugarColumn(IsPrimaryKey =true)] + public DateTime dateTime { get; set; } + [SqlSugar.SugarColumn(IsPrimaryKey = true)] + public string name { get; set; } + } +}