Hoping someone could shed some light from a performance standpoint on using OrganizationServiceContext.CreateQuery
vs using FetchXML
(or QueryExpression
).
I have made extensive use of LINQ
but am new to CRM. CreateQuery
seems like a good fit for my skill set but I wonder about performance in the end.
I realize that straight up
var result = from e in orgContext.CreateQuery("xyz_myentity")
where e["email"] == "[email protected]"
select e;
will return all attributes for xyz_myentity
, but I can't seem to find any documentation for the LINQ provider that sits on top of CRM. Will the using an anonymous type limit attributes returned from SQL / CRM? Or is the magic being done "client" side after the full set of data is returned from the server? Is the SQL query for all attributes and then is the LINQ provider building the anonymous type on top of that?
var result = from e in orgContext.CreateQuery("xyz_myentity")
where e["email"] == "[email protected]"
select new { Name=e["xyz_name"] };
Are there any other considerations related to the introduction of the OrganizationServiceContext
?