From 12bce8fa4d1354b5d48c3eaaf401cfdbb99c2781 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 7 Jul 2025 19:30:04 +0800 Subject: [PATCH] Add demo --- .../UserTestCases/UnitTest/Main.cs | 2 ++ .../UserTestCases/UnitTest/Unitsadfasys.cs | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unitsadfasys.cs diff --git a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs index 1daac965c..0faf511bf 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs @@ -33,6 +33,8 @@ namespace OrmTest } public static void Init() { + Unitsadfasys.Init(); + Unitsadfasys.Init(); Unitadfasfysdfyss.Init(); Unitsfasdyd.Init(); Unitafdsafsss.Init(); diff --git a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unitsadfasys.cs b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unitsadfasys.cs new file mode 100644 index 000000000..0be6eead8 --- /dev/null +++ b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unitsadfasys.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + public class Unitsadfasys + { + public static void Init() + { + var db = NewUnitTest.Db; + var data=db.Deleteable( + new UnitDeletedsfsa() { A = "a" } + ).ToSql(); + if (!data.Key.Contains("N'")) throw new Exception("unit error"); + + var data2 = db.Deleteable( + new UnitDeletedsfsa2() { A = "a" } + ).ToSql(); + if (data2.Key.Contains("N'")) throw new Exception("unit error"); + } + public class UnitDeletedsfsa + { + [SqlSugar.SugarColumn(SqlParameterDbType =System.Data.DbType.String,IsPrimaryKey =true)] + public string A { get; set; } + } + public class UnitDeletedsfsa2 + { + [SqlSugar.SugarColumn(IsPrimaryKey = true)] + public string A { get; set; } + } + } +}