From 57d1aa665bf621c1f600056b99f7d25ea175f209 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 1 Feb 2025 13:07:59 +0800 Subject: [PATCH] Add demo --- .../UserTestCases/UnitTest/Main.cs | 1 + .../UserTestCases/UnitTest/Unityadfasasdfa.cs | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unityadfasasdfa.cs diff --git a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs index c243bff00..849631a4b 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs @@ -33,6 +33,7 @@ namespace OrmTest } public static void Init() { + Unityadfasasdfa.Init(); Unitsdfaafa.Init(); Unitadfayyadfa.Init(); Unitsdfa1231.Init(); diff --git a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unityadfasasdfa.cs b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unityadfasasdfa.cs new file mode 100644 index 000000000..13e1742a4 --- /dev/null +++ b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unityadfasasdfa.cs @@ -0,0 +1,42 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + internal class Unityadfasasdfa + { + public static void Init() + { + var db = NewUnitTest.Db; + db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings() + { + IsCorrectErrorSqlParameterName = true + }; + try + { + db.Ado.ExecuteCommand("CREATE TABLE [unitadfaaaafa2](\r\n[打印费(折扣等)] varchar(255) NOT NULL,id varchar(50) )"); + } + catch (Exception) + { + + } + db.Updateable() + .SetColumns(it =>it.a==it.a ) + .Where(it=>it.id=="a") + .ExecuteCommand(); + Console.WriteLine("Start"); + } + [SugarTable("unitadfaaaafa2")] + public class Unitadfa121 + { + [SqlSugar.SugarColumn(ColumnName ="打印费(折扣等)")] + public string a { get; set; } + [SqlSugar.SugarColumn(IsPrimaryKey =true)] + public string id { get; set; } + } + } +}