mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
update demo
This commit is contained in:
parent
3ea4977b8c
commit
a891cf00fc
@ -20,7 +20,8 @@ namespace OrmTest
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true
|
||||
});
|
||||
db.DbMaintenance.CreateDatabase();
|
||||
db.DbMaintenance.CreateDatabase();
|
||||
db.Aop.OnLogExecuting = (s, p) =>Console.WriteLine( UtilMethods.GetNativeSql(s, p));
|
||||
db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1
|
||||
db.Insertable(new CodeFirstTable1() { Name = "a", Text="a" }).ExecuteCommand();
|
||||
var list = db.Queryable<CodeFirstTable1>().ToList();
|
||||
@ -138,7 +139,7 @@ namespace OrmTest
|
||||
public string Name { get; set; }
|
||||
[SugarColumn(ColumnDataType = "varchar(255)")]//custom
|
||||
public string Text { get; set; }
|
||||
[SugarColumn(IsNullable = true)]
|
||||
[SugarColumn(IsNullable = true,DefaultValue = "current_timestamp")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user