Dapper.Oracle icon indicating copy to clipboard operation
Dapper.Oracle copied to clipboard

Problem with GuessType in BulkSql/BulkOperation.cs

Open Yalchin-cs opened this issue 4 years ago • 0 comments

Hello There!

First of all, thank you very much for the library.

I have found the following problem in file Dapper.Oracle/BulkSql/BulkOperation.cs:

line 79: var dbType = map.DbType ?? OracleMapper.GuessType(obj.First().GetType());

In the above line OracleMapper.GuessType(obj.First().GetType()) does not work as expected, because obj.First().GetType() returns generic class type in place of property type. I think, it should be changed from "obj.First().GetType()" to "obj.Select(map.Property).ToArray().First().GetType()" which returns the required property type.

Thanks & Regards

Yalchin-cs avatar Jan 11 '22 05:01 Yalchin-cs