hello,
in our Organisation we have several virtual entity lookups linked on our Incident entity.
When we query it by id with LINQ, it is much slower than with Retrieve from SDK (in average 2100m vs 500ms). It is even slower when querying only incidents where these lookups are not null.
When only non virtual fields are selected, than it is equally quick with all methods.
Has anyone had such experience?
Can somebody measure it on his System on some entity with wirtual field lookups?
It looks to me like LINQ Assemblies/drivers are not working well with such lookups.
Here ist the code:
-------- LINQ -----
I
context.IncidentSet.Where(x => x.IncidentId == incidentId).Select(x => new Incident
{
IncidentId = x.IncidentId,
CustomerId = x.CustomerId,
TicketNumber = x.TicketNumber,
MyVirtualFieldLookup1 = x.MyVirtualFieldLookup1,
MyVirtualFieldLookup2 = x.MyVirtualFieldLookup2,
MyVirtualFieldLookup3 = x.MyVirtualFieldLookup3
}).FirstOrDefault();
-------- Retrieve -----
var columnSet = new ColumnSet(
Incident.LogicalNames.IncidentId
, Incident.LogicalNames.CustomerId
, Incident.LogicalNames.TicketNumber
, Incident.LogicalNames.MyVirtualFieldLookup1
, Incident.LogicalNames.MyVirtualFieldLookup2
, Incident.LogicalNames.MyVirtualFieldLookup3);
service.Retrieve(Incident.EntityLogicalName, incidentId, columnSet).ToEntity<Incident>();