mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
- 优化 BulkCopy 对可空类型的属性处理;#227
This commit is contained in:
parent
db15d436d8
commit
85a6ae49e4
@ -563,7 +563,10 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
var val = col.Item1.GetMapValue(d);
|
var val = col.Item1.GetMapValue(d);
|
||||||
if (col.Item3 == true)
|
if (col.Item3 == true)
|
||||||
{
|
{
|
||||||
if (val == null) throw new Exception($"[{didx}].{col.Item1.CsName} 值不可为 null;DataTable 限制不可使用 int?/long? 可空类型,IInsert.ToDataTable 将映射成 int/long,因此不可接受 null 值");
|
//if (val == null) throw new Exception($"[{didx}].{col.Item1.CsName} 值不可为 null;DataTable 限制不可使用 int?/long? 可空类型,IInsert.ToDataTable 将映射成 int/long,因此不可接受 null 值");
|
||||||
|
if (val == null)
|
||||||
|
val = DBNull.Value;
|
||||||
|
else
|
||||||
val = Utils.GetDataReaderValue(col.Item2, val);
|
val = Utils.GetDataReaderValue(col.Item2, val);
|
||||||
}
|
}
|
||||||
row[rowIndex++] = val;
|
row[rowIndex++] = val;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user