Search code examples
entity-frameworkentity-framework-coredb-first

Difference between Scaffold-DbContext and dotnet-ef-dbcontext-scaffold


I see that there are to way how to scaffold entities and db context in Entity Framework Core 2.0.

  1. using Scaffold-DbContext
  2. using dotnet ef dbcontext scaffold

Why there are two tools and what is the difference?


Solution

  • Scaffold-DbContext runs in Visual Studio's NuGet Package Manager Console (PMC) and has better VS integration--opens files and infers the startup project.

    dotnet ef dbcontext scaffold is a general command-line interface that can run outside of Visual Studio (and Windows).

    Otherwise, they execute the exact same logic.