实体框架 EDMX 文件提供程序是否特定?
我不想使用带有提供程序 System.Data.SqlClient 的 Sql Server 2008 作为生产环境,以及带有提供程序 System.Data.SqlServerCe.4.0 的 Sql Server Compact 4.0 来与 SpecFlow 进行集成测试。
是否可以在实体框架中针对不同环境使用相同的 edmx 文件? 如果答案是“是”,我如何拆分 EDMX 并保留不同的映射?
我已经有了使用 Sql Server 2008 的生产环境,并从实体模型生成了 Sql Server 紧凑型 4.0 文件 (.sdf),但是当我尝试连接到紧凑型数据库时,它给了我各种错误。
我在 EDMX 文件中找到了这一行: Provider=“System.Data.SqlClient”
I wan't to use Sql Server 2008 as production environment with provider System.Data.SqlClient and Sql Server compact 4.0 with provider System.Data.SqlServerCe.4.0 for integration testing with SpecFlow.
Is it possible to use the same edmx file in Entity Framework for the different environments?
In case of Yes as an answer, how can I split the EDMX and keep different mappings?
I already have the production environment working with Sql Server 2008 and have generated a Sql Server compact 4.0 file (.sdf) from the Entity Model but when i try to connect to the compact database it gives me various errors.
I found this line in my EDMX file:Provider="System.Data.SqlClient"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为如果您按如下方式更改值,则可以使用 SQL CE:
I think it will be possible to use SQL CE, if you change the values as folows: