How to update a product database by entity framework core 1.0 rc2 -
in entity framework core 1.0 rc1 when published website, generated ef.cmd file, can ran ef database update
update product database. how can in rc2 when there no ef.cmd file.
with rc2, need install tooling via project.json file, issue dotnet restore
. here sample project.json brings in entityframeworkcore.sqlite:
{ "version": "1.0.0-*", "buildoptions": { "emitentrypoint": true }, "dependencies": { "microsoft.netcore.app": { "type": "platform", "version": "1.0.0-rc2-3002702" }, "microsoft.entityframeworkcore.tools": { "type": "build", "version": "1.0.0-preview1-final" }, "microsoft.entityframeworkcore.sqlite": "1.0.0-rc2-final", "microsoft.extensions.configuration.json": "1.0.0-rc2-final", }, "tools": { "microsoft.entityframeworkcore.tools": { "imports": ["portable-net451+win8"], "version": "1.0.0-preview1-final" } }, "frameworks": { "netcoreapp1.0": { "imports": "portable-net451+win8" } } }
the important parts here are:
"microsoft.entityframeworkcore.tools": { "type": "build", "version": "1.0.0-preview1-final" }
and
"tools": { "microsoft.entityframeworkcore.tools": { "imports": ["portable-net451+win8"], "version": "1.0.0-preview1-final" } },
these tell dotnet restore
command download tooling entity framework. you'll able use .net core cli entity framework functionality.
this let things like:
$ dotnet ef migrations add mymigration $ dotnet ef database update
Comments
Post a Comment