mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	- 优化 string IsNullable = false 时插入 null 自动转为 "" #445;
This commit is contained in:
		@@ -92,6 +92,8 @@ namespace FreeSql.Internal.CommonProvider
 | 
			
		||||
                    if (changedDict != null && changedDict.ContainsKey(col.Attribute.Name) == false)
 | 
			
		||||
                        changedDict.Add(col.Attribute.Name, true);
 | 
			
		||||
                }
 | 
			
		||||
                if (val == null && col.Attribute.MapType == typeof(string) && col.Attribute.IsNullable == false)
 | 
			
		||||
                    col.SetValue(data, val = "");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -171,6 +171,8 @@ namespace FreeSql.Internal.CommonProvider
 | 
			
		||||
                            col.SetValue(data, val = FreeUtil.NewMongodbId());
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if (val == null && col.Attribute.MapType == typeof(string) && col.Attribute.IsNullable == false)
 | 
			
		||||
                    col.SetValue(data, val = "");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -359,6 +359,8 @@ namespace FreeSql.Internal.CommonProvider
 | 
			
		||||
                        if (changedDict != null && changedDict.ContainsKey(col.Attribute.Name) == false)
 | 
			
		||||
                            changedDict.Add(col.Attribute.Name, true);
 | 
			
		||||
                    }
 | 
			
		||||
                    if (val == null && col.Attribute.MapType == typeof(string) && col.Attribute.IsNullable == false)
 | 
			
		||||
                        col.SetValue(data, val = "");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -379,6 +381,8 @@ namespace FreeSql.Internal.CommonProvider
 | 
			
		||||
                    if (changedDict != null && changedDict.ContainsKey(col.Attribute.Name) == false)
 | 
			
		||||
                        changedDict.Add(col.Attribute.Name, true);
 | 
			
		||||
                }
 | 
			
		||||
                if (val == null && col.Attribute.MapType == typeof(string) && col.Attribute.IsNullable == false)
 | 
			
		||||
                    col.SetValue(data, val = "");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user