EFCore.BulkExtensions
EFCore.BulkExtensions copied to clipboard
feat: specify custom primary key for BulkInsert(OrUpdate)(OrDelete)(Async)
Have you considered enabling users to specify a custom key for "merges"?
My use case is that I have a table that tracks statuses for a given entity, and the primary key takes the natural form of "EntityId", "id" to avoid key collision on multiple inserts. I now want to insert statuses where the ["EntityId", "Status"] combination does not exists from before (no issue with conflicts because it's a one way street). This could be achieved with a custom key of ["EntityId", "Status"], PropertiesToIncludeOnUpdate = [].
My target database is PG.
Did you checked UpdateByProperties info from ReadMe, that should do it.