Often when developing high scale projects, and when performance is very crucial and critical if needed any aggregation function on a Plugin, Custom Workflow Activity or even a custom Application when retrieving data from crm, we should use Fetch XML.
When i have to do that, usually i have two options use an advanced find to get the xml (Button that says Download Fetch XML), or we can use a method from the SDK to do the same, please see the below example: Where queryExpression
Often, a CRM consultant has to develop some custom code to work with large result sets, below is an example that it can be found in the SDK using LINQ. I will do my tests as well to see the best option to use (Linq, QueryExpression and Fetch) in terms of performance and time to develop as well, however below is the LINQexample: The following example shows how to page the results of a LINQ query by using the Take and Skip operators: int pageSize = 5;
var accountsByPage = (from