列设置nullable只支持RequiredAttribute和Nullable<>
This commit is contained in:
		
							parent
							
								
									e8b8b6000d
								
							
						
					
					
						commit
						dfc4e91cd6
					
				@ -37,13 +37,13 @@ namespace Falcon.SugarApi.DatabaseDefinitions
 | 
			
		||||
                //if (sc != null) {
 | 
			
		||||
                //    c.IsNullable = sc.IsNullable;
 | 
			
		||||
                //}
 | 
			
		||||
                var isNullableTypes = new Type[] { typeof(string) };
 | 
			
		||||
                if (isNullableTypes.Contains(pt)) {
 | 
			
		||||
                    c.IsNullable = true;
 | 
			
		||||
                }
 | 
			
		||||
                else {
 | 
			
		||||
                    c.IsNullable = false;
 | 
			
		||||
                }
 | 
			
		||||
                //var isNullableTypes = new Type[] { typeof(string) };
 | 
			
		||||
                //if (isNullableTypes.Contains(pt)) {
 | 
			
		||||
                //    c.IsNullable = true;
 | 
			
		||||
                //}
 | 
			
		||||
                //else {
 | 
			
		||||
                //    c.IsNullable = false;
 | 
			
		||||
                //}
 | 
			
		||||
                //if (pt == typeof(string) && pt.GetCustomAttribute<RequiredAttribute>() == null) {
 | 
			
		||||
                //    c.IsNullable = true;
 | 
			
		||||
                //}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user