Code: Select all
from l in header.Orderlines
join t in context.ItemType on l.itemId equals t.Id
select new { l.id, l.desc, t.name }
I was expecting a join in one sql. Our program is running really slow since some joined tables have 100000 of posts.
If i instead do
Code: Select all
... new { l.id, l.desc, l.ItemType.name }
This example may be fixed by specifying that the refered table should be loaded at same time (loadoption), but if the link is multiple "steps" away, I still get ugly performance.
I also tried to do a storeprocedure like this
Code: Select all
... new {l.id, l.desc, context.GetItemTypeName(l.id) }
Running 5.25.39, can't run a later version since our long-running-storeprocedures will timeout.