How do I create all the respective table in SQL Server database?
NajibbUllah opened this issue · comments
Hi, I have cloned this project and found it very interesting. It has tremendous features to learn. I am trying to register a user by using WebApi (/api/Auth/Register). But it gives an error that "Invalid object name 'Users'.". So my question is how do I create all the tables in the SQL-Server database?
Hello, this project uses entity framework code-first databases.
Open package manager console, select Persistence
project as default. And make sure your WebAPI
project is startup project.
Than run command update-database
. That should automatically create and migrate database.
There is a problem with the migration. I created a pull request in 71. Users migration is problematic. For example, there is no initial data. For this reason, foreign key tables give an error.
Pull the repository, and try again.
After pulling new changes. Tables have been created successfully. And User has been registered successfully in the database. But there is an issue in AddRefreshToken method after registering a USER or login a USER.
The issue is "Non-exhaustive switch expression failed to match its input.
Unmatched value was Unchanged."
So this issue should be closed. Please open a new one for any non-related other issues.