Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Purpose of package "Microsoft.EntityFrameworkCore.Design"

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.

like image 706
grokky Avatar asked Mar 03 '17 08:03

grokky


People also ask

What is Microsoft EntityFrameworkCore design used for?

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.

What is Microsoft EntityFrameworkCore?

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.


1 Answers

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.

like image 54
bricelam Avatar answered Oct 08 '22 10:10

bricelam