mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update TDengineTest
This commit is contained in:
parent
e76ad97828
commit
deeed0b65b
@ -30,7 +30,6 @@ namespace TDengineTest
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//建表
|
||||
CodeFirst(db);
|
||||
|
||||
|
@ -9,7 +9,19 @@ namespace TDengineTest
|
||||
{
|
||||
public static void CodeFirst(SqlSugarClient db)
|
||||
{
|
||||
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>();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,21 @@
|
||||
using System;
|
||||
using SqlSugar.TDengine;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace TDengineTest
|
||||
{
|
||||
public class AllCSharpTypes
|
||||
[SqlSugar.SugarTable("AllCSharpTypes09")]
|
||||
public class AllCSharpTypes : STable
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
public DateTime Ts { get; set; }
|
||||
public bool Boolean { get; set; }
|
||||
public byte Byte { get; set; }
|
||||
public sbyte SByte { get; set; }
|
||||
public char Char { get; set; }
|
||||
public decimal Decimal { get; set; }
|
||||
[SqlSugar.SugarColumn(Length =18,DecimalDigits =2)]
|
||||
[SqlSugar.SugarColumn(Length = 18, DecimalDigits = 2)]
|
||||
public decimal Decimal2 { get; set; }
|
||||
[SqlSugar.SugarColumn(Length = 18, DecimalDigits = 2)]
|
||||
public double Double { get; set; }
|
||||
@ -23,7 +27,15 @@ namespace TDengineTest
|
||||
public short Int16 { get; set; }
|
||||
public ushort UInt16 { get; set; }
|
||||
public string String { get; set; }
|
||||
[SqlSugar.SugarColumn(Length =100)]
|
||||
[SqlSugar.SugarColumn(Length = 100)]
|
||||
public string String2 { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class CodeFirst1 : STable
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
public DateTime Ts { get; set; }
|
||||
public bool Boolean { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user