Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
few days back i have changed the CRUD operations code . entity framework SP to LINQ.
now i can able to see frequent sql server block. let me know why?

is linq insert or concurrent linq insert make my Database performance?

What I have tried:

once the performance based sql server utilisation high or CRUD via linq with concurrent users its make sense. i really don't understand
Posted
Updated 12-Oct-16 1:04am

1 solution

If there was no compelling reason to use LINQ then go back to SPs if they work. If you've written a whole bunch of LINQ code without any consideration as to how the SQL is generated then the SQL you're running will be very different from SPs, there will be lots of table access you don't know about and all sorts.

If you are joining tables then make sure you're not using "lazy loading" (google "entity framework lazy loading"). You can also use tools like SQL Profiler to see the SQL being generated.

At the end of the day though, just go back to SPs if they work. LINQ's advantages are around not having to write a lot of SQL yourself but you have to be mindful of how you're asking EF to generate the SQL, it's a big subject outside the scope of a forum post. Don't think LINQ is a panacea that gives you better performance etc as well as easier code.
 
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