From e4a9a88259aabcd62619b20f6ac9120496fc2094 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 10 Oct 2023 13:28:34 +0800 Subject: [PATCH] Add demo --- .../QuestDbTest/Demo/DemoE_CodeFirst.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs b/Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs index 2a69154a9..3fd92a24e 100644 --- a/Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs +++ b/Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using static OrmTest.DemoE_CodeFirst; namespace OrmTest { @@ -23,6 +24,7 @@ namespace OrmTest { Console.WriteLine(s); }; + db.CodeFirst.InitTables(); db.DbMaintenance.CreateDatabase(); db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1 db.Insertable(new CodeFirstTable1() { Name = "a", Text = "a" }).ExecuteCommand(); @@ -33,6 +35,32 @@ namespace OrmTest TestGuid(db); Console.WriteLine("#### CodeFirst end ####"); } + [SugarTable("QuestdbTestData3")] + + public class QuestdbTestData3 + + { + + //不支持自增和主键 (标识主键是用来更新用的) + + [SugarColumn(IsPrimaryKey = true)] + + public string Id { get; set; } + [SugarColumn(IsJson = true)] + + public List Data { get; set; } + + + + [TimeDbSplitField(DateType.Year)] + + public DateTime Time1 { get; set; } + + } + public class QuestdbTestData + { + public int xx { get; set; } + } private static void TestGuid(SqlSugarClient db) { db.CodeFirst.InitTables();