mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- 优化 string IsNullable = false 时插入 null 自动转为 "" #445;
This commit is contained in:
parent
d025603997
commit
8eadde930f
@ -532,5 +532,14 @@
|
||||
<param name="that"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Extensions.DependencyInjection.FreeSqlRepositoryDependencyInjection.AddFreeRepository(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{FreeSql.FluentDataFilter},System.Reflection.Assembly[])">
|
||||
<summary>
|
||||
批量注入 Repository,可以参考代码自行调整
|
||||
</summary>
|
||||
<param name="services"></param>
|
||||
<param name="globalDataFilter"></param>
|
||||
<param name="assemblies"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
@ -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 = "");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user