henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
611 stars 99 forks source link

Allow non-generated primary keys #123

Closed henkmollema closed 5 years ago

henkmollema commented 5 years ago

Add a way to decorate/specify whether a primary is not auto-generated by the underlying data store so you can specify it yourself. This is enables using pre-generated GUIDs as keys and fixes #115.

hmshafeeq commented 5 years ago

@henkmollema Thanks for building such an awesome API. I want to migrate to this in my project which is based on mysql database. Can you please confirm when this issue can be fixed ? I am generating primary keys (guids) from code behind before inserting them to database in the other dapper library.

henkmollema commented 5 years ago

Yes, this will be fixed in the 2.0 release.

etnobal commented 2 years ago

@henkmollema, my apologies for what is most likely a stupid question but how would my CustomKeyPropertyResolver have to look to tell Dommel that all my PKs are generated in my code and therefore provided in the object when executing the Insert method? I couldn't find an example.

My database column name is "id" so no need for a custom naming convention other than the lowercase which I already implemented using the CustomColumnNameResolver.