My Database doesn't appear to be populated, yet when I run my program, the website does show correct
The information from my database initialiser does show up on my website, but when I look in the SQL Server Object Explorer, there seems to be no data
Initialiser Code if it helps: https://paste.mod.gg/bxebrzqarvwn/0
BlazeBin - bxebrzqarvwn
A tool for sharing your source code with the world!

4 Replies
Have you tried to debug your code in DBInitialiser at line 11?
I tried removing it and restarting the program, still doesn't appear in the database
It does appear to have them, but I am just wondering why I can't view it in the server object explorer
First, I would check a few things to isolate the problem. I see 3 obvious resons, why your code won't run:
1. It's never called
2. context.Products.Any() is true => your save is never called
3. the code is actually for any reasons not persisted.
My code is running, I have tried removing the context.products.any() block and that still didnt show the data in my table, and im not sure what you mean by 3 though ive now noticed its duplicated the amount of products, It makes me wonder if it is being saved to another database somehow?
