提交 cd5de367 编写于 作者: A Adam Schroder

Use MemberInfoKey in BulkInsert to support complex properties #609

上级 a28cb5a0
......@@ -70,8 +70,8 @@ private static DataTable BuildBulkInsertDataTable<T>(IDatabase db, IEnumerable<T
foreach (var col in cols)
{
bulkCopy.ColumnMappings.Add(col.Value.MemberInfoData.Name, col.Value.ColumnName);
table.Columns.Add(col.Value.MemberInfoData.Name, Nullable.GetUnderlyingType(col.Value.MemberInfoData.MemberType) ?? col.Value.MemberInfoData.MemberType);
bulkCopy.ColumnMappings.Add(col.Value.MemberInfoKey, col.Value.ColumnName);
table.Columns.Add(col.Value.MemberInfoKey, Nullable.GetUnderlyingType(col.Value.MemberInfoData.MemberType) ?? col.Value.MemberInfoData.MemberType);
}
foreach (var item in list)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册