yangzhongke / Zack.EFCore.Batch

Deleting or Updating multiple records from a LINQ Query in a SQL statement without loading entities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for multiple primary keys

abrasat opened this issue · comments

I tried to test your great library with some Oracle database table, where the primary key is a combination of 3 columns.
The call of DeleteRangeAsync() method throws the exception "Only entity types with one single primary key are supported."
Could you please add the support of entities with multiple primary keys to the library?
Thanks in advance.

Thanks for your feedback.
I don't think the composite key is a good practice, and it will make the project more complex, so the library only supports single-key.

@yangzhongke Thanks for the reply. I agree that the composite key is not a good practice, and I also design the databases with single primary keys. But very oft there are legacy databases which have composite keys, where the customer decided the database schema and nothing can be changed. For such cases the option to support composite primary keys would be a very useful feature

Thanks for your message, but my schedule is too tight to support it. If you would like to go through the code and contribute this feature, I'd be happy to assist you.