如何将EF核心安装到现有数据库中? [英] How to scaffold EF core to existing DB?
问题描述
我正在尝试使用 Entity Framework Core
对现有数据库进行反向工程。我试图遵循的指示Microsoft ,但出现错误:
I am trying to reverse engineer an existing database using Entity Framework Core
. I tried to follow the directions from Microsoft but I am presented with the error:
无法找到名称为EntityFramework的提供程序程序集。确保指定的名称正确并且已被项目引用。
Unable to find provider assembly with name EntityFramework. Ensure the specified name is correct and is referenced by the project.
我正在从项目目录运行以下命令:
I am running the following command from the project directory:
dnx ef dbcontext scaffold "Server=REMOVED;Database=REMOVED;User ID=REMOVED;Password=REMOVED" EntityFramework
我在做什么错了?
推荐答案
确保您位于项目文件夹中,而不是解决方案文件夹上下文中。昨天我可以将其与以下代码一起使用(注意EntityFramework.MicrosoftSqlServer最后)
Make sure you are in the project folder and not the solution folder context. I was able to get this to work with the following yesterday (Notice the EntityFramework.MicrosoftSqlServer at the end)
dnx ef dbcontext scaffold "{connectionString}" EntityFramework.MicrosoftSqlServer
编辑:
确保在project.json中包含以下内容:
Make sure to include the following in your project.json:
EntityFramework.MicrosoftSqlServer.Design
这篇关于如何将EF核心安装到现有数据库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!