mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 21:56:03 +08:00
Update demo
This commit is contained in:
parent
bc269029dc
commit
4e144454db
@ -56,14 +56,23 @@ namespace TDengineTest
|
||||
private static void CodeFirst5(SqlSugarClient db)
|
||||
{
|
||||
|
||||
STable.Tags = new List<ColumnTagInfo>()
|
||||
{
|
||||
new ColumnTagInfo(){ Name="t1", Value="1" },
|
||||
new ColumnTagInfo(){ Name="t2",Value="2"}
|
||||
};
|
||||
db.CodeFirst.InitTables<CodeFirstTags33>();
|
||||
|
||||
db.Insertable(new CodeFirstTags33()
|
||||
{
|
||||
Boolean = true,
|
||||
Ts = DateTime.Now
|
||||
}).ExecuteCommand();
|
||||
|
||||
|
||||
db.CodeFirst.InitTables<CodeFirstTags44>();
|
||||
|
||||
db.Insertable(new CodeFirstTags44()
|
||||
{
|
||||
Boolean = true,
|
||||
Ts = DateTime.Now
|
||||
}).ExecuteCommand();
|
||||
|
||||
db.CodeFirst.InitTables<CodeFirstTags1>();
|
||||
STable.Tags = null;
|
||||
|
||||
}
|
||||
|
||||
|
@ -44,14 +44,24 @@ namespace TDengineTest
|
||||
public DateTime Ts { get; set; }
|
||||
public bool Boolean { get; set; }
|
||||
}
|
||||
|
||||
public class CodeFirstTags1:STable
|
||||
[STableAttribute( STablelName = "CodeFirstStable", Tags="[{ Name:\"Tag1\",Value:\"1\"}]")]
|
||||
public class CodeFirstTags44
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
public DateTime Ts { get; set; }
|
||||
public bool Boolean { get; set; }
|
||||
[SqlSugar.SugarColumn(IsIgnore =true)]
|
||||
public string Tag1 { get; set; }
|
||||
}
|
||||
[STableAttribute(STablelName = "CodeFirstStable", Tags = "[{ Name:\"Tag1\",Value:\"2\"}]")]
|
||||
public class CodeFirstTags33
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
public DateTime Ts { get; set; }
|
||||
public bool Boolean { get; set; }
|
||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
public string Tag1 { get; set; }
|
||||
}
|
||||
|
||||
public class CodeFirst04
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
|
Loading…
Reference in New Issue
Block a user