• Increase font size
  • Default font size
  • Decrease font size

Tip #77: Don't use .Where extension method when querying ListItem objects

PDF

Never use the IQueryable<T>.Where extension method when querying ListItem objects.

The reason is that the client object model first evaluates the result of the CAML query, retrieves the results, and then filters the resulting collection using LINQ. If you filter a very large list using LINQ instead of CAML, the client object model attempts to retrieve all items in the list before filtering with LINQ and either issues queries that require too much system resources, or the query fails. The reason is not clear unless you know how the client object model works internally.

You must use CAML when querying list items.

Source



Digg! Technorati! Diigo! Reddit! Del.icio.us! Google! Live! Facebook! StumbleUpon! Yahoo! Joomla Portal

Comments (0)

Subscribe to this comment's feed

Write comment


busy
 

Buy me a coffee and donuts


Disclaimer

Views and suggestions expressed on this site do not necessarily reflect the Microsoft position and we don't hold liablily for tips and recommendations. You should be aware that some information represented on site might be officially unsupported, could potentially damage your SharePoint installation, and could lead to a lack of support from Microsoft.