nbarbettini / little-aspnetcore-book

The Little ASP.NET Core Book, a friendly introduction to web programming and ASP.NET Core 2.0
http://littleasp.net/book
Creative Commons Attribution 4.0 International
702 stars 190 forks source link

Error "Create a migration" #67

Closed ytmjatai closed 6 years ago

ytmjatai commented 6 years ago

Following the tutorials, when i do the step "Create a new service class" and try to test it out, the website doesn't return the right view. It show : SqliteException: SQLite Error 1: 'no such table: Items'.

I add a "Items" migration and apply it the the database, the application work well. I think the toturial's step "Create a migration" maybe have a mistake.

It should be dotnet ef migrations add Items

but not to be dotnet ef migrations add AddItems

mattwelke commented 6 years ago

It actually doesn't matter what you name your migration as you create it. It's just a label used for the developer(s) to know what that migration was for. Can you try to reproduce your issue, and create a public Git repo with your code at the point in time where despite having created and ran the migration, you get the error you mention? (SQLite Error 1: 'no such table: Items')

ytmjatai commented 6 years ago

@welkie It's my fault,i don't install missing files when i open the project folder with vscode the first time. thank you for your reply.