Firstly, we have two options to query SharePoint lists (Caml - LINQ).
LINQ converts to CAML query so CAML query will be better for performance.
note that: the LINQ to SharePoint provider is a new feature in SharePoint 2010.
CAML query advantages :
1- a good performance.
2- CAML Query Builder tool will help you to generate Queries
CAML query disadvantages :
1- not parsed at compile time so it will throw the runtime error if any error occured.
2- consuming time to debug.
Linq to SharePoint advantages:
1- LINQ to SharePoint use lazy loading means that the query does not execute until using the result set. In another word: Lazy loading is a concept where we delay the loading of the object until the point where we need it. Putting in simple words, on demand object loading rather than loading objects unnecessarily.
2- easy LINQ syntax to generate queries so LINQ to SharePoint hides the
complexity of developing CAML queries.
3- code will be more readable.
Linq to SharePoint disadvantages:
1- bad performance because it will be converted to CAML.
0 comments:
Post a Comment