From b3b45e5e0a3b67884bd233a3a6398e24c30d44fe Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 13 Nov 2023 11:24:02 +0800 Subject: [PATCH] Add test case --- .../SqliteTest/UserTestCases/Main.cs | 1 + .../SqliteTest/UserTestCases/Unitafadsa.cs | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Src/Asp.NetCore2/SqliteTest/UserTestCases/Unitafadsa.cs diff --git a/Src/Asp.NetCore2/SqliteTest/UserTestCases/Main.cs b/Src/Asp.NetCore2/SqliteTest/UserTestCases/Main.cs index 481c4dec9..17eba2b6d 100644 --- a/Src/Asp.NetCore2/SqliteTest/UserTestCases/Main.cs +++ b/Src/Asp.NetCore2/SqliteTest/UserTestCases/Main.cs @@ -32,6 +32,7 @@ namespace OrmTest } public static void Init() { + Unitafadsa.Init(); UnitSplitTask.Init(); UnitBulkMerge.Init(); UnitBizDelete.Init(); diff --git a/Src/Asp.NetCore2/SqliteTest/UserTestCases/Unitafadsa.cs b/Src/Asp.NetCore2/SqliteTest/UserTestCases/Unitafadsa.cs new file mode 100644 index 000000000..a8528c017 --- /dev/null +++ b/Src/Asp.NetCore2/SqliteTest/UserTestCases/Unitafadsa.cs @@ -0,0 +1,48 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + internal class Unitafadsa + { + public static void Init() + { + var db = NewUnitTest.Db; + db.CodeFirst.InitTables(); + db.CodeFirst.InitTables(); + db.Queryable().ToList(); + } + + + /// + /// 多主键表 + /// + [SugarTable("dbschool")] + public class School + { + [SugarColumn(IsPrimaryKey = true)] + public string Id { get; set; } + + [SugarColumn(IsPrimaryKey = true)] + public int SchoolId { get; set; } + } + /// + /// 多主键表 + /// + [SugarTable("dbschool")] + public class School2 + { + [SugarColumn(IsPrimaryKey = true)] + public string Id { get; set; } + + [SugarColumn(IsPrimaryKey = true)] + public int SchoolId { get; set; } + + public string Remark { get; set; } + } + } +}