mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 16:18:47 +08:00
Add demo
This commit is contained in:
parent
8d206851dc
commit
49fd674eff
@ -22,10 +22,17 @@ namespace OrmTest
|
|||||||
db.DbMaintenance.CreateDatabase();
|
db.DbMaintenance.CreateDatabase();
|
||||||
db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1
|
db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1
|
||||||
db.Insertable(new CodeFirstTable1() { Name = "a", Text="a" }).ExecuteCommand();
|
db.Insertable(new CodeFirstTable1() { Name = "a", Text="a" }).ExecuteCommand();
|
||||||
var list = db.Queryable<CodeFirstTable1>().ToList();
|
db.CodeFirst.InitTables<CharTest>();
|
||||||
|
db.Insertable(new CharTest() { xx = Guid.NewGuid().ToString() }).ExecuteCommand();
|
||||||
|
var list=db.Queryable<CharTest>().ToList();
|
||||||
Console.WriteLine("#### CodeFirst end ####");
|
Console.WriteLine("#### CodeFirst end ####");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class CharTest
|
||||||
|
{
|
||||||
|
[SugarColumn(ColumnDataType ="char(36)")]
|
||||||
|
public string xx { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class CodeFirstTable1
|
public class CodeFirstTable1
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user