This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Guys, thanks for a great product. I am currently trying to do a few queries with the join and have noticed some unusually behaviour. For example here is some code using Linq2Sql which works fine: Snippet var dbClasses = new DataClasses1DataContext(); This fires off some SQL to the database which has two joins in the SQL with all the where clauses attached. If I do the same thing with Lightspeed: Snippet var unitOfWork = new LightSpeedModelUnitOfWork();
Then I get "Function evaluation timed out", and the count actually returns the full count of the OndpRequest table (no db call though). If I remove one of the joins, for example: Snippet var filteredProjects = from project in lsProjects2 Then SQL is sent to the database and the where clause for Projects is created but the where clause applied to Customers isn't applied. Would you be able to let me know if I am doing something wrong, or whether this functionality isn't yet supported or will be supported later? Thanks!!
|
|
|
Hi Frank, Joining against a subquery (as you are doing above) is not supported by the LINQ provider yet, however this is planned for the near future. In the meantime you can express these types of joins by using the LightSpeed Querying API: e.g. var q1 = new Query() { EntityType = typeof(OndpCustomer) };
Alternatively if you are able to restructure your LINQ query into a single query you would be able to directly join against the IQueryable roots (unitOfWork.OndpProjects and unitOfWork.OndpCustomers) and just express the appropriate criteria as a single statement, but I suspect you may have a reason for keeping it in seperate parts in which case using the querying API will likely be a better fit.
Jeremy |
|
|
Hi Frank, We have now added support for this in to the nightly builds - let us know how you get on with this.
Jeremy |
|
|
Hi Jeremy Thanks for letting us know, my initial tests show it is working great! Are there any limitations to the join or should I be ok to throw everything at it... --Frank |
|