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