Most common PowerShell commands for Entity Framework core

 Most common PowerShell commands for EF CORE

Once you install the package
PM> Install-Package Microsoft.EntityFrameworkCore.Tools

you can bale to run command:
PM> Get-Help Entityframeworkcore

you will get output like:

PM> Get-Help Entityframeworkcore

                     _/\__
               ---==/    \\
         ___  ___   |.    \|\
        | __|| __|  |  )   \\\
        | _| | _|   \_/ |  //|\\
        |___||_|       /   \\\/\\

TOPIC
    about_EntityFrameworkCore

SHORT DESCRIPTION
    Provides information about the Entity Framework Core Package Manager Console Tools.

LONG DESCRIPTION
    This topic describes the Entity Framework Core Package Manager Console Tools. See https://docs.efproject.net for
    information on Entity Framework Core.

    The following Entity Framework Core commands are available.

        Cmdlet                      Description
        --------------------------  ---------------------------------------------------
        Add-Migration               Adds a new migration.

        Drop-Database               Drops the database.

        Get-DbContext               Gets information about a DbContext type.

        Remove-Migration            Removes the last migration.

        Scaffold-DbContext          Scaffolds a DbContext and entity types for a database.
        Example: Scaffold-DbContext -Connection Name=[BookStoresDB] Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -force
        Note: [BookStoresDB] >> read from config file connection string.
        Script-Migration            Generates a SQL script from migrations.

        Update-Database             Updates the database to a specified migration.
        
SEE ALSO
    Add-Migration
    Drop-Database
    Get-DbContext
    Remove-Migration
    Scaffold-DbContext
    Script-Migration

    Update-Database

Most useful EF commands are:  Add-Migration <name>
Remove-migration
update-Database
update-database-migration <name>
remove-migration - Force

Comments