Browse Source

Update demo

pull/31/MERGE
sunkaixuan 2 years ago
parent
commit
ca9f4d0298
  1. 13
      Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/Program.cs

13
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<UnitDatez211afa2222>();
sqlugar.CodeFirst.InitTables<UnitDatez211afa2222>();
sqlugar.Insertable(new UnitDatez211afa2222()).ExecuteCommand();
sqlugar.Insertable(new UnitDatez211afa2222() { dateOnly=DateOnly.FromDateTime(DateTime.Now) }).ExecuteCommand();
var list2=sqlugar.Queryable<UnitDatez211afa2222>().ToList();
}
static void ServerTest()
{
@ -131,3 +137,10 @@ 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; }
}
Loading…
Cancel
Save