Update TDengine

This commit is contained in:
sunkaixuan
2023-10-01 20:16:14 +08:00
parent 7896b00dc1
commit 6c961c3d46
3 changed files with 38 additions and 12 deletions

View File

@@ -29,7 +29,7 @@ namespace TDengineTest
}
}
});
//建表
CodeFirst(db);

View File

@@ -11,17 +11,36 @@ namespace TDengineTest
{
CodeFirst1(db);
db.CodeFirst.InitTables<AllCSharpTypes>();
db.Insertable(new AllCSharpTypes() { Ts = DateTime.Now, Boolean = true, Char = 'a', Decimal = Convert.ToDecimal(18.2), Int16 = 1, Int32 = 1, Int64 = 1, String = "2" }).ExecuteCommand();
var list3 = db.Queryable<AllCSharpTypes>().ToList();
db.CodeFirst.InitTables<AllCSharpTypes>();
db.CodeFirst.InitTables<CodeFirst03>();
db.Insertable(new CodeFirst03()
{
Ts = DateTime.Now,
Boolean = true,
Char = 'a',
Decimal = Convert.ToDecimal(18.2),
Int16 = 16,
Int32 = 32,
Int64 = 64,
String = "string",
SByte=3,
Byte = 2,
Decimal2 = Convert.ToDecimal(18.3),
Double = Convert.ToDouble(18.44),
Float = Convert.ToSingle(18.45),
String2 = "2",
UInt16=116,
UInt32=332,
UInt64=664
}).ExecuteCommand();
var dt = db.Ado.GetDataTable("select * from CodeFirst03 ");
var list3 = db.Queryable<CodeFirst03>().ToList();
}
private static void CodeFirst1(SqlSugarClient db)
{
db.CodeFirst.InitTables<CodeFirst1>();
db.Insertable(new CodeFirst1() { Boolean = true, Ts = DateTime.Now }).ExecuteCommand();
var list = db.Queryable<CodeFirst1>().ToList();
db.CodeFirst.InitTables<CodeFirst01>();
db.Insertable(new CodeFirst01() { Boolean = true, Ts = DateTime.Now }).ExecuteCommand();
var list = db.Queryable<CodeFirst01>().ToList();
}
}
}