zzzprojects / Dapper-Plus

Dapper Plus - High-Efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET
https://dapper-plus.net/
383 stars 85 forks source link

Bug BulkMerge case Key is String #74

Closed lopesclayton closed 3 years ago

lopesclayton commented 3 years ago

I have a table where a primary key is a text field (saves the GUI), and when using BulkMerge it returns the error [An error has occurred, no primary key has been found or resolved.]

JonathanMagnan commented 3 years ago

Hello @lopesclayton ,

Is the property name matches the column name in the database?

Otherwise, could you provide a runnable small project with only this error so we could investigate it?

Best Regards,

Jon

lopesclayton commented 3 years ago

Hi @JonathanMagnan

attached is a small example, with the database thanks

BugDapperPlus.zip

JonathanMagnan commented 3 years ago

Thank you @lopesclayton ,

We can successfully reproduce it with your project.

We will look at it and fix it.

JonathanMagnan commented 3 years ago

Hello @lopesclayton ,

The v3.0.25 has been released

Could you try it and let us know if everything is now working as expected?

Best Regards,

Jon

lopesclayton commented 3 years ago

Hello @JonathanMagnan keeps generating the error

BugDapperPlus

JonathanMagnan commented 3 years ago

Thank you @lopesclayton ,

I will talk with my developer.

JonathanMagnan commented 3 years ago

Hello @lopesclayton ,

My developer thinks the issue now currently happens because you point to a database that doesn't exist. As weird as it sounds, if you point to a database file that doesn't exist, you can still open a connection and our library can still query some meta information that we will use later (for example, we can "retrieve" the table but it return no column.

To fix it, you only have to either use the full path or change the Copy to Output Directory to Copy Always for example. So your project will now point to the good database file.

I indeed tested it and can confirm that I got the same issue before modifying the setting with the latest version.

Let me know if that's clear.

Best Regards,

Jon