MVC4中是否有替代EF的替代方案 [英] Is there a alternative for EF in MVC4

查看:79
本文介绍了MVC4中是否有替代EF的替代方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在sql数据库中有一个超过1000个表的项目。我正在使用MVC4,我不想使用Entity Framework,因为我的项目经常使用CRUD操作。为Entity Framework建议一个替代方案。

解决方案

EF是一个ORM。 dotnet有很多ORM。你可以从这里开始: http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software [ ^ ](.net部分)。但你也可以google,因为还有更多 - 更多。



但是如果因为大表号而害怕任何性能问题(可能是你可以使用简单的旧方法(SQLCommand和它的朋友)。不过,我不确定,你真的获得了很多。 EF非常好,而且你在生命周期的其他场景中没有使用ORM就会失去很多。



但是要为你的需求选择最好的ORM ......好吧,这可能是一项具有挑战性的任务。性能和复杂性是两个相反的事情。您可以在一端放置EF和NHybernate,例如在另一端放置一个: ServiceStack.OrmLite [ ^ ]。但你必须根据你的实际需要来决定。



我的意见:如果你最终得到1000多个表,你可能应该环顾其他数据存储概念,喜欢 noSQL [ ^ ]。

I have a project with more than 1000 tables in sql database. I am using MVC4 and I do not want to use Entity Framework as my project will frequently use CRUD operations. Suggest an alternative for Entity Framework.

解决方案

EF is an ORM. There are many ORMs for dotnet. You can start here: http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software[^] (section .net). But you can also google for it, because there are more - many more.

But if you are afraid of any performance issues because of the large table number (might be an architectural mistake on it's own), you can use the plain old approach (SQLCommand and it's friends). Still, I am not sure, that you really gain a lot. EF is really good, and you loose a lot on other scenes of the lifecycle by not using an ORM.

But to choose the best ORM for your needs... well, that could be a challenging task. Performance and complexity are two opposite things. You could place EF and NHybernate on one end and this one for example at the other one: ServiceStack.OrmLite[^]. But you have to decide based on your real needs.

My opinion: if you end up with 1000+ tables, you probably should look around in other data store concepts, like noSQL[^].


这篇关于MVC4中是否有替代EF的替代方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆