From 90bdb831c730f2566577b91480f2434b36202258 Mon Sep 17 00:00:00 2001 From: falcon <9504402@qq.com> Date: Fri, 21 Oct 2022 09:14:28 +0800 Subject: [PATCH] =?UTF-8?q?sqlsugar=E9=85=8D=E7=BD=AE=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E5=88=97=E6=9C=8D=E5=8A=A1=E5=92=8C=E8=A1=A8=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntityServices/SetupKeyColumnServices.cs | 5 +++++ .../EntityServices/SetupLengthColumnServices.cs | 3 +++ Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs | 2 -- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Falcon.SugarApi/DatabaseDefinitions/EntityServices/SetupKeyColumnServices.cs b/Falcon.SugarApi/DatabaseDefinitions/EntityServices/SetupKeyColumnServices.cs index 730e38c..9b681e8 100644 --- a/Falcon.SugarApi/DatabaseDefinitions/EntityServices/SetupKeyColumnServices.cs +++ b/Falcon.SugarApi/DatabaseDefinitions/EntityServices/SetupKeyColumnServices.cs @@ -14,6 +14,11 @@ namespace Falcon.SugarApi.DatabaseDefinitions.EntityServices if (p.TryGetAttribute(out var _)) { c.IsPrimarykey = true; } + //属性只要加了SugarColumn特性,不管是不是增加SugarColumn(IsPrimarykey=false),IsPrimarykey都是false + //只要存在SugarColumn特性KeyAttribute便会无效。 + //if (p.TryGetAttribute(out var sc)) { + // c.IsPrimarykey = sc.IsPrimaryKey; + //} } } } diff --git a/Falcon.SugarApi/DatabaseDefinitions/EntityServices/SetupLengthColumnServices.cs b/Falcon.SugarApi/DatabaseDefinitions/EntityServices/SetupLengthColumnServices.cs index c09c611..7be2c9e 100644 --- a/Falcon.SugarApi/DatabaseDefinitions/EntityServices/SetupLengthColumnServices.cs +++ b/Falcon.SugarApi/DatabaseDefinitions/EntityServices/SetupLengthColumnServices.cs @@ -20,6 +20,9 @@ namespace Falcon.SugarApi.DatabaseDefinitions.EntityServices if (p.TryGetAttribute(out var la)) { len.Add(la.Length); } + if (p.TryGetAttribute(out var sc)) { + len.Add(sc.Length); + } if (len.Any()) { c.Length = len.Max(); } diff --git a/Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs b/Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs index 2d7c74b..5064eeb 100644 --- a/Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs +++ b/Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs @@ -54,8 +54,6 @@ namespace Falcon.SugarApi.DatabaseDefinitions }; } - private static ICacheService? CacheService = null; - /// /// 通过配置实现Redis缓冲,必须单例实现. /// 默认:127.0.0.1:6379,password=,connectTimeout=3000,connectRetry=1,syncTimeout=10000,DefaultDatabase=0