Option #1 - update

The former route should be the most reasonable one, except it can cause some data loss or other consistency issues due to the fact that our ApplicationDbContext and ApplicationUser classes experienced some major changes. Although Entity Framework should be able to handle everything properly, it will mostly depend on what we did to our data during the various CRUD tests we performed in the last three chapters.

The risk of data loss is also stated by the yellow message "An operation was scaffolded that may result in the loss of data..." shown by the Command Prompt upon completing the migration task; if we look at the preceding screenshot, we can clearly see it (third line from the bottom).

If we want to take this route, we can start issuing this command:

dotnet ef database update

Once done, without running the project, do the following:

  1. Open the SQL Server Object Explorer in Visual Studio.
  2. Navigate to the TestMakerFree database and expand it.
  3. Right-click on the dbo.Users table and select View Data.
  4. Delete all the existing rows (select them all, and then right-click | Delete).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.178.237