Problem solved. I can't explain why the Seed
method wasn't running but I've learnt a lot more about how to use Data-Migrations
now which is a nice side-effect. I had made modifications to my model which I had scripted in a new migration file manually. It turns out I needn't have bothered as there's a tool that will do it for me, namely Add-Migration
. Armed with this knowledge I rolled my model back to pre-modification, ran the InitialCreate
which worked as expected with seed taking place, then ran the Add-Migration
method which created the new migration file for me and now everything is working as expected again with the Seed
method running every time.
I can't quite explain why the Seed
method wasn't executing but everything is working as expected again now following the above process.