How do I run a SQL command during seeding on ASP.NET Boilerplate?
I need to run a complicated query so I think it will be easier to use a stored procedure to offload the computing onto SQL Server.
I've successfully created a custom repository which injects ActiveTransactionProvider
and uses ADO.NET from the DbContext to run the query.
Now I want to check if the stored procedure exists and if not create it in the seeding when the backend starts up.
I tried to use ADO.NET from the DbContext passed SeedHelper but I get an exception that I need a transaction even though the transaction scope has been set to suppressed in the helper. I don't see where I can inject the active transaction provider during seeding so I'm stuck.