diff --git a/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/Program.cs b/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/Program.cs index 0c64c5ac6..2a49035ad 100644 --- a/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/Program.cs +++ b/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/Program.cs @@ -40,6 +40,12 @@ static void MyTest() var d1 = new UnitDate01231().dateOnly; var d2 = new UnitDate01231().timeOnly; + if(sqlugar.DbMaintenance.IsAnyTable("UnitDatez211afa2222",false)) + sqlugar.DbMaintenance.DropTable(); + sqlugar.CodeFirst.InitTables(); + sqlugar.Insertable(new UnitDatez211afa2222()).ExecuteCommand(); + sqlugar.Insertable(new UnitDatez211afa2222() { dateOnly=DateOnly.FromDateTime(DateTime.Now) }).ExecuteCommand(); + var list2=sqlugar.Queryable().ToList(); } static void ServerTest() { @@ -130,4 +136,11 @@ public class UnitDatez211afa { public TimeOnly timeOnly { get; set; } public DateOnly dateOnly { get; set; } +} +public class UnitDatez211afa2222 +{ + [SugarColumn(IsNullable =true)] + public TimeOnly? timeOnly { get; set; } + [SugarColumn(IsNullable = true)] + public DateOnly? dateOnly { get; set; } } \ No newline at end of file