Add unit test

This commit is contained in:
sunkaixuan 2023-08-11 18:16:26 +08:00
parent 183c4681a3
commit f133f4de0d

View File

@ -27,6 +27,11 @@ namespace OrmTest
}
}
});
db.CodeFirst.InitTables<CodeFirstDFAAFA>();
db.Insertable(new List<CodeFirstDFAAFA>() {
new CodeFirstDFAAFA(){ timeOffset=DateTimeOffset.Now,timeOffset2=DateTimeOffset.Now },
new CodeFirstDFAAFA() { timeOffset = DateTimeOffset.Now, timeOffset2 = DateTimeOffset.Now }
}).ExecuteCommand();
// db.DbMaintenance.CreateDatabase();
if (db.DbMaintenance.IsAnyTable("CodeFirstTable1", false))
db.DbMaintenance.DropTable("CodeFirstTable1");
@ -57,6 +62,12 @@ namespace OrmTest
Console.WriteLine("#### CodeFirst end ####");
}
}
public class CodeFirstDFAAFA
{
public DateTimeOffset timeOffset { get; set; }
[SugarColumn(ColumnDataType = "timestamp with time zone")]
public DateTimeOffset timeOffset2 { get; set; }
}
public class CodeFirstadfafa
{
public string index { get; set; }