Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions FreeSql/Extensions/FreeSqlGlobalExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dynamic> source)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要使用 dynamic ,如果你是用的基类型是 ExpandoObject 那么可以 使用它的基类 IDictionary<string,Object>

{

if (source?.Any() == true)
{
var newSource = source.Select(t => new Dictionary<string, object>(t));
foreach (var dict in newSource) LocalReplaceDictDBNullValue(dict);
}
var insertOrUpdateDict = new InsertOrUpdateDictImpl(freesql);
insertOrUpdateDict._insertOrUpdateProvider.SetSource(source);
return insertOrUpdateDict;
}
/// <summary>
/// 删除数据字典 Dictionary&lt;string, object&gt;
/// </summary>
Expand Down