We have the issue of having to seed a rather big reference table (ok, tables) as part of an EF migration. The normal EF approach broke down (basically the build OOMed), so we switched to executing a .sql script as part of the migration (which is nicely supported, thank you). However, if we compare those INSERTs to a bulk copy approach like eg https://www.krisvandermast.com/post/2022/03/23/using-sqlbulkcopy-with-dotnet-lists.html, the performance is still abysmal.
Is there any way to hook into a specific migration and execute the seeding using bulk copy? I have seen issues that looked similar but weren't, but maybe I was looking with the wrong search terms. (and yes, I really want to lock a specific bulk copy operation to a specific migration, really replacing standard seeding with it).
Currently this is not possible. https://github.com/dotnet/efcore/issues/24710 would enable this as it tracks adding generic lifecycle hooks that run before and after every migration.
We have the issue of having to seed a rather big reference table (ok, tables) as part of an EF migration. The normal EF approach broke down (basically the build OOMed), so we switched to executing a .sql script as part of the migration (which is nicely supported, thank you). However, if we compare those INSERTs to a bulk copy approach like eg https://www.krisvandermast.com/post/2022/03/23/using-sqlbulkcopy-with-dotnet-lists.html, the performance is still abysmal.
Is there any way to hook into a specific migration and execute the seeding using bulk copy? I have seen issues that looked similar but weren't, but maybe I was looking with the wrong search terms. (and yes, I really want to lock a specific bulk copy operation to a specific migration, really replacing standard seeding with it).
Is that possible at all?