mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Add unit test
This commit is contained in:
parent
05eea9a403
commit
4607276f2b
@ -23,10 +23,17 @@ namespace OrmTest
|
||||
db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1
|
||||
db.Insertable(new CodeFirstTable1() { Name = "a", Text="a" }).ExecuteCommand();
|
||||
var list = db.Queryable<CodeFirstTable1>().ToList();
|
||||
db.CodeFirst.InitTables<CodeFirstChar2>();
|
||||
db.Insertable(new CodeFirstChar2() { CharTest = '1' }).ExecuteCommand();
|
||||
var list2=db.Queryable<CodeFirstChar2>().ToList();
|
||||
Console.WriteLine("#### CodeFirst end ####");
|
||||
}
|
||||
}
|
||||
|
||||
public class CodeFirstChar2
|
||||
{
|
||||
[SqlSugar.SugarColumn(ColumnDataType ="varchar(1)")]
|
||||
public char CharTest { get; set; }
|
||||
}
|
||||
public class CodeFirstTable1
|
||||
{
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||
|
Loading…
Reference in New Issue
Block a user