GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - badsyntax/vscode-entity-framework: Manage Entity Framework migrations in VS Code.

BranchesTags
Open more actions menu

Latest commit

 

History

171 Commits
171 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
icons
icons
 
 
images
images
 
 
sample_dotnet
sample_dotnet
 
 
src
src
 
 
webview-ui
webview-ui
 
 
.editorconfig
.editorconfig
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.ncurc.json
.ncurc.json
 
 
.nvmrc
.nvmrc
 
 
.prettierignore
.prettierignore
 
 
.prettierrc.js
.prettierrc.js
 
 
.vscodeignore
.vscodeignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
icon.png
icon.png
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
webpack.config.js
webpack.config.js
 
 

Repository files navigation

Entity Framework

Build & Publish

A VS Code extension to manage Entity Framework migrations.

Entity Framework Migrations

Requirements

  • dotnet sdk
  • efcore tools
  • Microsoft.EntityFrameworkCore.Design must be installed in one of the projects

Features

  • List migrations by DbContext
  • Add / Remove / Run / Undo migrations
  • Show migration applied status
  • Reset (Squash) Migrations
  • Export DbContext as SQL script
  • View DbContext information
  • Scaffold DbContext & entity types
  • Generate ER Diagram (Requires EF Core 7+)

Getting Started

Set the project and startupProject configuration for the workspace by clicking on the Configure icon in the tree view:

Entity Framework Extension Configure

Extension Settings

This extension contributes the following settings:

  • entityframework.project: Target Project

    Example
    {
      "entityframework.project": "src/Infrastructure"
    }
  • entityframework.startupProject: Startup Project

    Example
    {
      "entityframework.startupProject": "ExampleAPI"
    }
  • entityframework.commands: Custom commands

    Example
    {
      "entityframework.commands": {
        "addMigration": [
          "dotnet",
          "ef",
          "migrations",
          "add",
          "\"$migrationName\"",
          "--project",
          "\"$project\"",
          "--startup-project",
          "\"$startupProject\"",
          "--context",
          "\"$dbContext\""
        ],
        "removeMigration": [
          "dotnet",
          "ef",
          "migrations",
          "remove",
          "--project",
          "\"$project\"",
          "--startup-project",
          "\"$startupProject\"",
          "--context",
          "\"$dbContext\""
        ],
        "runMigration": [
          "dotnet",
          "ef",
          "database",
          "update",
          "--project",
          "\"$project\"",
          "--startup-project",
          "\"$startupProject\"",
          "--context",
          "\"$dbContext\"",
          "\"$migrationId\""
        ],
        "generateScript": [
          "dotnet",
          "ef",
          "dbcontext",
          "script",
          "--project",
          "\"$project\"",
          "--startup-project",
          "\"$startupProject\"",
          "--context",
          "\"$dbContext\""
        ],
        "listDbContexts": [
          "dotnet",
          "ef",
          "dbcontext",
          "list",
          "--project",
          "\"$project\"",
          "--startup-project",
          "\"$startupProject\""
        ],
        "listMigrations": [
          "dotnet",
          "ef",
          "migrations",
          "list",
          "--context",
          "\"$context\"",
          "--project",
          "\"$project\"",
          "--startup-project",
          "\"$startupProject\""
        ],
        "dbContextInfo": [
          "dotnet",
          "ef",
          "dbcontext",
          "info",
          "--context",
          "\"$dbContext\"",
          "--project",
          "\"$project\"",
          "--startup-project",
          "\"$startupProject\""
        ],
        "scaffold": [
          "dotnet",
          "ef",
          "dbcontext",
          "scaffold",
          "\"$connectionString\"",
          "\"$provider\"",
          "--output-dir",
          "\"$outputDir\"",
          "--context",
          "\"$context\"",
          "--project",
          "\"$project\"",
          "--context-dir",
          "\"$contextDir\"",
          "--namespace",
          "\"$namespace\""
        ],
        "generateERD": [
          "dotnet",
          "ef",
          "dbcontext",
          "scaffold",
          "\"$connectionString\"",
          "\"$provider\"",
          "--context",
          "\"$context\"",
          "--project",
          "\"$project\"",
          "--output-dir",
          "\"$outputDir\"",
          "--use-database-names"
        ]
      }
    }
  • entityframework.erDiagram.ignoreTables: A list of tables to ignore from the ER Diagram

    Example
    {
      "entityframework.erDiagram": {
        "ignoreTables": [".*Tracking$"]
      }
    }
  • entityframework.env: Custom environment variables

    Example
    {
      "entityframework.env": {
        "ASPNETCORE_ENVIRONMENT": "LocalDev",
        "TenantId": "12345"
      }
    }

ER Diagram

When generating an ER diagram, a Mermaid .t4 template will be installed into the project. You can ignore this file (by adding it to .gitignore), or add it to source control. The template file is used to generate the ER Diagram, feel free to customise it. If you delete it, it will be regenerated next time you generate an ER Diagram.

Entity Framework ER Diagram

Performance

The EF tools execute application code at design time to get information about the project, thus performance on large projects can be slow.

Support

  • 👉 Submit a bug report
  • 👉 Submit a feature request

License

See LICENSE.md.

About

Manage Entity Framework migrations in VS Code.

marketplace.visualstudio.com/items?itemName=richardwillis.vscode-entity-framework

Topics

dotnetentityentity-frameworkmigrations

Resources

Readme
MIT license
Activity

Stars

17 stars

Watchers

3 watching

Forks

3 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.