gpt4 book ai didi

ef-code-first - 如何将 EF 核心脚手架到现有数据库?

转载 作者:行者123 更新时间:2023-12-04 17:17:10 27 4
gpt4 key购买 nike

我正在尝试使用 Entity Framework Core 对现有数据库进行逆向工程.我试着按照指示from Microsoft但我遇到了错误:

Unable to find provider assembly with name EntityFramework. Ensure the specified name is correct and is referenced by the project.



我正在从项目目录运行以下命令:
dnx ef dbcontext scaffold "Server=REMOVED;Database=REMOVED;User ID=REMOVED;Password=REMOVED" EntityFramework

我究竟做错了什么?

最佳答案

确保您位于项目文件夹而不是解决方案文件夹上下文中。昨天我能够让它与以下一起工作(注意最后的 EntityFramework.MicrosoftSqlServer)

dnx ef dbcontext scaffold "{connectionString}" EntityFramework.MicrosoftSqlServer

编辑:

确保在您的 project.json 中包含以下内容:
EntityFramework.MicrosoftSqlServer.Design

关于ef-code-first - 如何将 EF 核心脚手架到现有数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35301214/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com