mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Add TDengine Demo
This commit is contained in:
parent
07f76e56f3
commit
0db5698993
@ -18,6 +18,8 @@ namespace TDengineTest
|
||||
//简单建表
|
||||
CodeFirst2(db);
|
||||
|
||||
CodeFirst4(db);
|
||||
|
||||
//更多建表用例
|
||||
db.CodeFirst.InitTables<CodeFirst03>();
|
||||
db.Insertable(new CodeFirst03()
|
||||
@ -56,5 +58,17 @@ namespace TDengineTest
|
||||
db.Insertable(new CodeFirst04() { Boolean = true, Ts = DateTime.Now }).ExecuteCommand();
|
||||
var list = db.Queryable<CodeFirst04>().ToList();
|
||||
}
|
||||
private static void CodeFirst4(SqlSugarClient db)
|
||||
{
|
||||
db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
PgSqlIsAutoToLower = false,
|
||||
PgSqlIsAutoToLowerCodeFirst = false,
|
||||
};
|
||||
db.CodeFirst.InitTables<CodeFirst05>();
|
||||
db.Insertable(new CodeFirst05() { Boolean = true, Ts = DateTime.Now }).ExecuteCommand();
|
||||
var list = db.Queryable<CodeFirst05>().ToList();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,5 +49,11 @@ namespace TDengineTest
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
public DateTime Ts { get; set; }
|
||||
public bool Boolean { get; set; }
|
||||
}
|
||||
}
|
||||
public class CodeFirst05
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
public DateTime Ts { get; set; }
|
||||
public bool Boolean { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user