diff --git a/FreeSql/Extensions/FreeSqlGlobalExtensions.cs b/FreeSql/Extensions/FreeSqlGlobalExtensions.cs index 0a2e12961..57117d2a6 100644 --- a/FreeSql/Extensions/FreeSqlGlobalExtensions.cs +++ b/FreeSql/Extensions/FreeSqlGlobalExtensions.cs @@ -1006,6 +1006,18 @@ public static InsertOrUpdateDictImpl InsertOrUpdateDict(this IFreeSql freesql, I insertOrUpdateDict._insertOrUpdateProvider.SetSource(source); return insertOrUpdateDict; } + public static InsertOrUpdateDictImpl InsertOrUpdateDict(this IFreeSql freesql, IEnumerable source) + { + + if (source?.Any() == true) + { + var newSource = source.Select(t => new Dictionary(t)); + foreach (var dict in newSource) LocalReplaceDictDBNullValue(dict); + } + var insertOrUpdateDict = new InsertOrUpdateDictImpl(freesql); + insertOrUpdateDict._insertOrUpdateProvider.SetSource(source); + return insertOrUpdateDict; + } /// /// 删除数据字典 Dictionary<string, object> ///