All tutorials agree that project.json
should include:
"Microsoft.EntityFrameworkCore.Design": { "type":"build", "version":"1.0.0-preview2-final" }
I have never included it, and have never had a problem.
I only include
"Microsoft.EntityFrameworkCore" "Microsoft.EntityFrameworkCore.Sqlite" (or Sqlserver) "Microsoft.EntityFrameworkCore.Tools"
What does this package do? Why can I exclude it without problems?
UPDATE: see comments in accepted answer to figure out which package to import in which scenario.
EntityFrameworkCore) Provides a simple API surface for configuring a IMutableModel that defines the shape of your entities, the relationships between them, and how they map to the database. You can use ModelBuilder to construct a model for a context by overriding OnModelCreating(ModelBuilder) on your derived context.
Entity Framework Core is a modern object-database mapper for . NET. It supports LINQ queries, change tracking, updates, and schema migrations. EF Core works with many databases, including SQL Database (on-premises and Azure), SQLite, MySQL, PostgreSQL, and Azure Cosmos DB.
Microsoft.EntityFrameworkCore.Design
contains all the design-time logic for Entity Framework Core. It's the code that all of the various tools (PMC cmdlets like Add-Migration
, dotnet ef
& ef.exe
) call into.
If you don't use Migrations or Reverse Engineering, you don't need it.
And when you do need it, we encourage PrivateAssets="All"
so it doesn't get published to the server where you almost certainly won't need it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With