mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Update demo
This commit is contained in:
@@ -26,9 +26,12 @@ namespace OrmTest
|
|||||||
db.CodeFirst.InitTables<CodeFirstChar2>();
|
db.CodeFirst.InitTables<CodeFirstChar2>();
|
||||||
db.Insertable(new CodeFirstChar2() { CharTest = '1' }).ExecuteCommand();
|
db.Insertable(new CodeFirstChar2() { CharTest = '1' }).ExecuteCommand();
|
||||||
var list2=db.Queryable<CodeFirstChar2>().ToList();
|
var list2=db.Queryable<CodeFirstChar2>().ToList();
|
||||||
db.Aop.OnLogExecuting = (s, p) => Console.WriteLine(UtilMethods.GetNativeSql(s, p));
|
db.Aop.OnLogExecuting = (s, p) => Console.WriteLine(UtilMethods.GetNativeSql(s, p));;
|
||||||
db.CodeFirst.InitTables<CodeFirstsaf>();
|
|
||||||
db.CodeFirst.InitTables<CODEFIRSTSAF>();
|
db.CodeFirst.InitTables<CODEFIRSTSAF>();
|
||||||
|
db.CodeFirst.InitTables<CodeFirstsaf>();
|
||||||
|
db.Insertable(new CodeFirstsaf() { Json = "a" })
|
||||||
|
.ExecuteCommand();
|
||||||
|
var list3=db.Queryable<CodeFirstsaf>().ToList();
|
||||||
Console.WriteLine("#### CodeFirst end ####");
|
Console.WriteLine("#### CodeFirst end ####");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,6 +39,8 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
[SugarColumn(DefaultValue ="")]
|
[SugarColumn(DefaultValue ="")]
|
||||||
public string Json { get; set; }
|
public string Json { get; set; }
|
||||||
|
[SugarColumn(DefaultValue = "1")]
|
||||||
|
public bool x { get; set; }
|
||||||
}
|
}
|
||||||
public class CODEFIRSTSAF
|
public class CODEFIRSTSAF
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user