views:

93

answers:

3

which one is preferable for Enterprise CMS development. LINQ or SP

A: 

I would cache the results from the database for a CMS as you likely to get the same data requested over and over again (cache the dataset, or use page caching, or cache the objects if using LINQ).

Then it doesn't matter if you use LINQ or an SP, but I would just use LINQ.

James Westgate
+1  A: 

Stored Procedures can be used with Linq2Sql (and Entity Framework), so it isn't a choice of one or another.

Oded
+1  A: 

Generally what I do is LINQ to Views and LINQ to Stored Procedures. It's not a question of what is preferred because LINQ solves how to manage the data once it's queried where Stored Procedures are run on the SQL side to allow for query manipulation (or for me, mostly saving) of data which takes away from having the code to do it which is slower.

I would say you would want to use both if necessary. Are you saving to Entities that require multiple tables saves as one Entity? If so, use Stored Procedures with LINQ. If you're using 1 to 1 Entity relations to your tables then just use LINQ.

Graham