mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-21 02:58:05 +08:00
Add demo
This commit is contained in:
@@ -19,13 +19,22 @@ namespace OrmTest
|
|||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true
|
IsAutoCloseConnection = true
|
||||||
});
|
});
|
||||||
db.DbMaintenance.CreateDatabase();
|
db.Aop.OnLogExecuting=(s,p)=>Console.WriteLine(s);
|
||||||
|
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();
|
var list = db.Queryable<CodeFirstTable1>().ToList();
|
||||||
Console.WriteLine("#### CodeFirst end ####");
|
Console.WriteLine("#### CodeFirst end ####");
|
||||||
|
db.CodeFirst.InitTables<UnitByte1>();
|
||||||
|
Console.WriteLine("#### CodeFirst end ####");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class UnitByte1
|
||||||
|
{
|
||||||
|
public byte[] bytes{ get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public class CodeFirstTable1
|
public class CodeFirstTable1
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user