C
C#10mo ago
DragonA.

Seed for DB does't work

Hi I have an a project on aspnet. After migration and updating DB I wanted to fill it up with data. I have made an Seed.cs file for this, but it don't work. When i start it in PowerShell it starts to execute it but DB doesn't seeded. And I don't have an idea what is wrong. This is GitHub repos of the project - https://github.com/KostinAntonKIUKI202/diploma
GitHub
GitHub - KostinAntonKIUKI202/diploma: ASP.NET/SQL Server 2019/TREK ...
ASP.NET/SQL Server 2019/TREK Bike catalog. Contribute to KostinAntonKIUKI202/diploma development by creating an account on GitHub.
2 Replies
SiloCitizen3
SiloCitizen310mo ago
I dont see you calling context.SaveChanges() to save the changes to the DB, in https://github.com/KostinAntonKIUKI202/diploma/blob/master/TREK_Web_Diploma/Data/Seed.cs
GitHub
diploma/TREK_Web_Diploma/Data/Seed.cs at master · KostinAntonKIUKI2...
ASP.NET/SQL Server 2019/TREK Bike catalog. Contribute to KostinAntonKIUKI202/diploma development by creating an account on GitHub.
DragonA.
DragonA.10mo ago
I have just seen, thanks. Such a simple mistake XD