From ca9f4d0298e3820e5b10004527c7de89bd127848 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 4 Apr 2023 15:45:14 +0800 Subject: [PATCH] Update demo --- .../Net7Test/NET7Test/NET7Test/Program.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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