mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	- 续上优化 Enum 默认值容错
This commit is contained in:
		@@ -163,8 +163,8 @@ namespace FreeSql.Internal
 | 
				
			|||||||
                            isEqualsEnumValue = true;
 | 
					                            isEqualsEnumValue = true;
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    if (isEqualsEnumValue == false)
 | 
					                    if (isEqualsEnumValue == false && enumValues.Length > 0)
 | 
				
			||||||
                        colattr.DbDefautValue = enumValues.Length > 0 ? enumValues.GetValue(0) : null;
 | 
					                        colattr.DbDefautValue = enumValues.GetValue(0);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if (colattr.DbDefautValue != null && p.PropertyType != colattr.MapType) colattr.DbDefautValue = Utils.GetDataReaderValue(colattr.MapType, colattr.DbDefautValue);
 | 
					                if (colattr.DbDefautValue != null && p.PropertyType != colattr.MapType) colattr.DbDefautValue = Utils.GetDataReaderValue(colattr.MapType, colattr.DbDefautValue);
 | 
				
			||||||
                if (colattr.DbDefautValue == null) colattr.DbDefautValue = tp?.defaultValue;
 | 
					                if (colattr.DbDefautValue == null) colattr.DbDefautValue = tp?.defaultValue;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user