-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: NullReferenceException
occurs during BulkMerge()
#964
Comments
NullReferenceException
during BulkMerge()
NullReferenceException
occurs during BulkMerge()
It sounds basic, probably just a method overload calls. We will investigate and get back to you. To speedup the investigations, can you as well share the table schema SQL script here? (Just rename the table if you would like) |
|
We will get back to you with this. Thanks a lot. |
Fix #964 Bug: NullReferenceException occurs during BulkMerge()
Fix #964 Removed logic that the ordering fields should be in the select
Hi, we have spent time replicating this issue, but, it is unfortunate that we could not replicate this. As a response, we created a small project as a simulation of your end to further start the investigation there. It is working on the mentioned versions (RepoDb v1.12.9, RepoDb.SqlServer v1.1.4, RepoDb.SqlServer.BulkOperations v1.1.5), and also on the latest beta version of RepoDB (RepoDb v1.12.10-beta4, RepoDb.SqlServer v1.1.5-beta4, RepoDb.SqlServer.BulkOperations 1.1.6-beta2). Please also note that it also workds on the latest main branch. Would you be able to modify this small project/solution and replicate the issue and revert to us? |
Bug Description
I get an
Object reference not set to an instance of an object
error when callingBulkMerge()
(I haven't tried other methods).I have tried calling both
.BulkMerge<XXX>(data)
(with a class mapping setup:ClassMapper.Add<XXX>("[dbo].[dbTableName]");
) and.BulkMerge("dbTableName", data)
, wheredata
is a DataTable that has been created from XXX.class objects.Notably, I don't have any attribute mappings (I presume RepoDB can default map types like int, data, string, etc.).
(I suspect the problem is something fairly obvious on my end).
Exception Message:
Schema and Model:
Model
Schema
The SQL schema is identical (names are identical). In terms of types,
nvarchar(100)
equates to C# strings and the identical SQL types are used for C# decimal, int and DateTime.Library Version:
RepoDb v1.12.9
RepoDb.SqlServer v1.1.4
RepoDb.SqlServer.BulkOperations v1.1.5
The text was updated successfully, but these errors were encountered: