henkmollema / Dommel

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

DatabaseGeneratedOption.None not working #269

Closed VillaltaJose closed 8 months ago

VillaltaJose commented 3 years ago

When using a custom primary key (in most cases varchar keys), dommel tries to put an auto increment key ignoring the SetGeneratedOption(DatabaseGeneratedOption.None) property.

guipcarvalho commented 2 years ago

I'm having the same issue here

henkmollema commented 1 year ago

What do you mean with SetGeneratedOption(DatabaseGeneratedOption.None)? Can you share an example of your model configuration?

henkmollema commented 8 months ago

There is a test case which verifies this behavior. Please let me know if it's still not working for you.

denovellis commented 5 months ago

I'm having the same issue. Here is a code sample :

` public class TestMap : DommelEntityMap { public TestMap() { ToTable("Business");

     Map(p => p.test_id).ToColumn("Id", caseSensitive: true).IsKey()
         .SetGeneratedOption(DatabaseGeneratedOption.None);

     Map(p => p.test_name).ToColumn("Name", caseSensitive: true);
     Map(p => p.test_count).ToColumn("Count", caseSensitive: true);
 }

}`