From 4e144454dbb73d8155362c96bdb79b6de6e66a3c Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 18 Nov 2023 23:50:08 +0800 Subject: [PATCH] Update demo --- .../Demo/ORMTest_Partial/1_CodeFirts.cs | 27 ++++++++++++------- .../Models/Unit/CodeFirstTest1.cs | 16 ++++++++--- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Src/Asp.NetCore2/TDengineTest/Demo/ORMTest_Partial/1_CodeFirts.cs b/Src/Asp.NetCore2/TDengineTest/Demo/ORMTest_Partial/1_CodeFirts.cs index 631979fd1..5d47d835b 100644 --- a/Src/Asp.NetCore2/TDengineTest/Demo/ORMTest_Partial/1_CodeFirts.cs +++ b/Src/Asp.NetCore2/TDengineTest/Demo/ORMTest_Partial/1_CodeFirts.cs @@ -55,16 +55,25 @@ namespace TDengineTest private static void CodeFirst5(SqlSugarClient db) { - - STable.Tags = new List() - { - new ColumnTagInfo(){ Name="t1", Value="1" }, - new ColumnTagInfo(){ Name="t2",Value="2"} - }; + + db.CodeFirst.InitTables(); + + db.Insertable(new CodeFirstTags33() + { + Boolean = true, + Ts = DateTime.Now + }).ExecuteCommand(); + + + db.CodeFirst.InitTables(); + + db.Insertable(new CodeFirstTags44() + { + Boolean = true, + Ts = DateTime.Now + }).ExecuteCommand(); + - db.CodeFirst.InitTables(); - STable.Tags = null; - } private static void CodeFirst1(SqlSugarClient db) diff --git a/Src/Asp.NetCore2/TDengineTest/Models/Unit/CodeFirstTest1.cs b/Src/Asp.NetCore2/TDengineTest/Models/Unit/CodeFirstTest1.cs index 764833bcd..68803e919 100644 --- a/Src/Asp.NetCore2/TDengineTest/Models/Unit/CodeFirstTest1.cs +++ b/Src/Asp.NetCore2/TDengineTest/Models/Unit/CodeFirstTest1.cs @@ -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)]