排除为 null 的情况

比如第一行 name null,第二行 name "xxx"
This commit is contained in:
Tony Han 2022-07-06 19:46:13 +08:00
parent d9093c840a
commit 562a436878

View File

@ -127,10 +127,10 @@ namespace FreeSql.Internal.CommonProvider
{ {
var tempDict = new Dictionary<string, object>(); var tempDict = new Dictionary<string, object>();
foreach (var item in dicType) foreach (var item in dicType)
{ {
foreach (string key in item.Keys) foreach (string key in item.Keys)
{ {
if (!tempDict.ContainsKey(key)) if (!tempDict.ContainsKey(key) && !(item[key] is null))
{ {
tempDict[key] = item[key]; tempDict[key] = item[key];
} }