Add unit test

This commit is contained in:
sunkaixuan 2023-06-28 14:19:04 +08:00
parent 743d14c8aa
commit 553e87547d

View File

@ -1,4 +1,5 @@
using SqlSugar;
using SqlSugar.DbConvert;
using System;
using System.Collections.Generic;
using System.Linq;
@ -26,10 +27,19 @@ namespace OrmTest
db.CodeFirst.InitTables<CodeFirst3311>();
db.Insertable(new CodeFirst3311() { }).ExecuteCommand();
db.Insertable(new CodeFirst3311() { ts = DateTime.Now.TimeOfDay }).ExecuteCommand();
db.CodeFirst.InitTables<CodeFirstadfafaAA>();
db.Insertable(new CodeFirstadfafaAA() { Name = "0" }).ExecuteCommand();
var list3=db.Queryable<CodeFirstadfafaAA>().ToList();
Console.WriteLine("#### CodeFirst end ####");
}
}
public class CodeFirstadfafaAA
{
[SugarColumn(ColumnDataType = "varchar(32)", SqlParameterDbType = typeof(CommonPropertyConvert))]
public string Name { get; set; }
public int carry_status { get; set; }
}
public class CodeFirst3311
{
[SugarColumn(IsNullable =true)]