哪个是更新mvc4中记录的最佳方法 [英] Which is the best way for updating records in mvc4

查看:76
本文介绍了哪个是更新mvc4中记录的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



任何人都可以建议我更新记录的最佳方法是在存储过程中编写更新查询并在Entity Framework中调用该存储过程或直接在Entity Framework中编写更新查询。哪种方式更快。我正在ASP.NET MVC4,Entity Framework5和SQL Server 2008中开发一个应用程序。

Hi
Any one can suggest me which is the best way for updating records either writing update query in stored procedure and call that stored procedure in Entity Framework or directly writing update query in Entity Framework. Which way is faster. I am developing an application in ASP.NET MVC4 ,Entity Framework5 and SQL Server 2008.

推荐答案

这取决于你的SP的复杂性。但是对于简单的表更新你可以使用内联简单实体框架更新查询。但是如果你有非常复杂的多表更新场景,那么使用SP与实体框架。它将提供比内联EF查询更好的性能。



如果您有任何疑问,请询问。
It depends on the complexity of your SP.But for simple table update you can use inline simple entity framework update query.But if you have very complex multiple table update scenario then use SP with entity framework.It'll give better performance than inline EF query.

If you have any questions,Please ask.


您可以使用Entity Framework但复杂的场景而不是使用Store Procedure。
you can use Entity Framework but complex scenario than use Store Procedure.


Linq是使用EntityFramework的最佳方法。它更快,更易读。存储过程很简单,如果存在大量数据,可能会造成混乱。 Linq可以更长但更高效。

谢谢:)
Linq is the best approach using EntityFramework. It is faster and more readable. Stored Procedures are trivial and might create chaos if large number of data are present. Linq can be longer but efficient.
Thank you :)


这篇关于哪个是更新mvc4中记录的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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