mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	- 优化 IsNullable = false 插入的数据值为 null 则以默认值插入(防止DB报错);#384
This commit is contained in:
		@@ -67,7 +67,7 @@ namespace FreeSql.Odbc.Dameng
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        object val = col.GetMapValue(d);
 | 
			
		||||
                        if (val == null && col.Attribute.IsNullable == false) val = Utils.GetDataReaderValue(col.CsType.NullableTypeOrThis(), null);//#384
 | 
			
		||||
                        if (val == null && col.Attribute.IsNullable == false) val = col.CsType == typeof(string) ? "" : Utils.GetDataReaderValue(col.CsType.NullableTypeOrThis(), null);//#384
 | 
			
		||||
                        if (_noneParameter)
 | 
			
		||||
                            sb.Append(_commonUtils.GetNoneParamaterSqlValue(specialParams, col.Attribute.MapType, val));
 | 
			
		||||
                        else
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user