Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more: , +
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.
Posted

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.
 
Share this answer
 
you can use Entity Framework but complex scenario than use Store Procedure.
 
Share this answer
 
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 :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900