需要有关将现有数据层\db 转换为实体框架的建议
将我们现有的数据层转换为实体框架长期以来一直是我的待办事项列表。我已经开始真正研究它,这似乎是一项艰巨的任务。我们当前的设置使用类型化数据集、数据适配器和数百个存储过程。所以我的问题是对于做过类似事情的人来说,你是如何进行的?我是否将所有存储过程转换为 lamaba 表达式以尝试将它们集成到实体框架中?谢谢,
埃里克
Converting our existing data-layer to the Entity Framework has been on my to-do list for a long time. I've started to really look into it and it seems like a daunting task. Our current setup uses typed datasets, data adapters, and a few hundred stored procs. So my question is for anyone who has done something similar how did you proceed? Do I convert all the stored procedures to lamaba expressions to try to integrate them into the Entity Framework? Thanks,
Eric
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将数百个存储过程重写为 linq-to-entities 查询并不是一个好主意。如果您迁移到 EF,您应该仍然使用这些存储过程,并且仅简化它们的调用和将结果映射到实体或复杂类型,以替换您的数据表。
数据集提供断开连接的更改集模式,因此使用数据集和 EF 实体可能存在很大差异。根据您使用数据集的方式,您可能必须检查实体框架 4 中的自我跟踪实体,它也提供断开连接的更改集模式,但有一些其他缺点。
这可能是一项非常困难且具有挑战性的任务,因此我个人认为如果没有任何 EF 经验,这不是一个好主意。
Rewritting hundred stored procedures into linq-to-entities queries is not a good idea. If you move to EF you should still use those stored procedure and only simplify their calling and mapping results into entities or complex types which will replace your data tables.
Datasets offers disconnected change set pattern so there can be a big difference in using data sets and EF entities. Based on the way how you use datasets you will probably have to check Self tracking entities in Entity framework 4 which also offers disconnected change set pattern but has some other disadvantages.
This can be quite difficult and challenging task so I personally don't think that it is good idea without any previous experience with EF.