sqlsugar配置模式化列服务和表服务
This commit is contained in:
		
							parent
							
								
									231d546e5d
								
							
						
					
					
						commit
						90bdb831c7
					
				@ -14,6 +14,11 @@ namespace Falcon.SugarApi.DatabaseDefinitions.EntityServices
 | 
			
		||||
            if (p.TryGetAttribute<KeyAttribute>(out var _)) {
 | 
			
		||||
                c.IsPrimarykey = true;
 | 
			
		||||
            }
 | 
			
		||||
            //属性只要加了SugarColumn特性,不管是不是增加SugarColumn(IsPrimarykey=false),IsPrimarykey都是false
 | 
			
		||||
            //只要存在SugarColumn特性KeyAttribute便会无效。
 | 
			
		||||
            //if (p.TryGetAttribute<SugarColumn>(out var sc)) {
 | 
			
		||||
            //    c.IsPrimarykey = sc.IsPrimaryKey;
 | 
			
		||||
            //}
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -20,6 +20,9 @@ namespace Falcon.SugarApi.DatabaseDefinitions.EntityServices
 | 
			
		||||
            if (p.TryGetAttribute<MaxLengthAttribute>(out var la)) {
 | 
			
		||||
                len.Add(la.Length);
 | 
			
		||||
            }
 | 
			
		||||
            if (p.TryGetAttribute<SugarColumn>(out var sc)) {
 | 
			
		||||
                len.Add(sc.Length);
 | 
			
		||||
            }
 | 
			
		||||
            if (len.Any()) {
 | 
			
		||||
                c.Length = len.Max();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -54,8 +54,6 @@ namespace Falcon.SugarApi.DatabaseDefinitions
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private static ICacheService? CacheService = null;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 通过配置实现Redis缓冲,必须单例实现.
 | 
			
		||||
        /// <para>默认:127.0.0.1:6379,password=,connectTimeout=3000,connectRetry=1,syncTimeout=10000,DefaultDatabase=0</para>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user