Hi All,
I'm looking for the best way to effectively simulate a join in a query without having to loop through an itemdatabound for a datalist to return entities for each row to get the data I need. I saw a posting here asking about joins and I understand that ES doesn't generate them but Mike offered to give advice on the best way to work around the issue. The posting is at http://community.entityspaces.net/forums/thread/3647.aspx.
I have an images table, listings table and listingimages table. The imageslistings is a bridge between to the two. I am trying to bind a datalist with information from the listingimages table based on the listingId. I need the the ImageId from the listingimages table and the ImageFileType from the Image table based on the join of ImageId between the two tables. I'd normally just query the ImageId and then on the ItemDataBound load up each Image entity to get the data I need but surely that has got to hit performance and isn't the best way of doing it? Can this be done and am I correct in thinking it will hit performance if I did it in the ItemDataBound?
Also another query I had was the query caching in the quick reference at: http://www.entityspaces.net/portal/Documentation/QuickReference/tabid/87/Default.aspx#customload. This databind that I am going to be doing could be used quite frequently on postbacks so caching the query to help performance, I'm assuming, would be beneficial also. The example just seems to show how to build a query into the EmployeesQuery object. Am i correct in thinking I should then just add this object to cache like so:
Cache["EmployeesQuery"] = q;
And retrieve like so:
EmployeesQuery q = Cache["EmployeesQuery"];
Sorry if the latter is a little bit of a stupid/basic question.
Lloyd
P.S. Is there any way you can get the forum to email when responses have been added to the questions?