Dotnet
Authentication and Authorization - Registration Part 2

Initial Data Migrations

PRO

I finished! On to the next chapter

Outline

Demo: Initial Data Migrations

Open Command Line Terminal
  • Click on the [View] Menu
  • Select [Terminal]
Install Entity Framework Command Line Tools
  • Type the following command
    • dotnet tool install -g dotnet-ef

Update EF Tools if you get this error (next check box item):   

The Entity Framework tools version '5.0.0' is older than that of the runtime '5.0.1'. Update the tools for the latest features and bug fixes. 
To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
Update Entity Framework Command Line Tools (if already installed)
  • Type the following command
    • dotnet tool update -g dotnet-ef
Setup Initial Create
  • Type the following command
    • dotnet ef migrations add InitialCreate --project Conduit.Data --startup-project Conduit.Api
Update Database using Migrations
  • Type the following command
    • dotnet ef database update --project Conduit.Data --startup-project Conduit.Api
View & Inspect Database
  • Click on the [View] Menu
  • Select [SQL Server Object Explorer]
  • Expand SQL Server
  • Expand (localdb)\MSSQLLocalDB
  • Expand Databases
  • Expand Conduit
  • Expand Tables
    • Inspect Tables for proper structure