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 again, I have this LINQ query: from l in this._uow.LogEntries Now the twist here is i'm joining with ExtranetUsers twice though 2 different foreign keys. EmployeeId is nullable, hence the left outer join (which isn't the problem here). Running this, LS generates this query: SELECT The problem is it's disregarding my second join, probably since i'm joining on the same table twice (as i have multiple joins on different tables in my project) Is there a special way of writing that specific type of query?
Thank you for your patience, i appreciate it Best regards, -Jonathan
P.S. I think i was clear enough this time, but if you need a small sample project of the issue, i'll gladly oblige! :) |
|
|
Hi Jonathan, Just a quite note to say I will have a look at this issue at the same time as the other issue you posted which uses the same model, I have added a quick LogEntry entity to the model to have a look at this one also. As a heads up, self joins and the handling of criteria in self join scenarios are not well supported by the current LINQ implementation which is noted on the limitations page (http://www.mindscape.co.nz/products/lightspeed/Help/Help%20Topics/LINQ/Limitations.html), but I believe you can probably achieve what you want using the underlying LightSpeed querying API, so I will get back to you on this once I have had a look.
Jeremy |
|
|
Hi Jeremy,
Thank you very much for the time you will be allowing to my issue. I will look into the querying API for this particular issue. This issue is far from mission critical (it's just a sort on a column, so i'm just disabling it for the moment).
Best regards, -Jonathan |
|
|
Hi guys, One of my colleagues faces an issue on subsequent outer joins (he also sent you an e-mail shortly, but judging by your previous record, I think you prefer the forum). Example query is: from s in Schedules
where s.RoomId == 1 && s.StartTime > DateTime.Now.AddHours(-3) && s.StartTime < DateTime.Now.AddHours(4)
join op in Personnels on s.Operator equals op.ID into p1
from s1 in p1.DefaultIfEmpty()
join a1 in Personnels on s.Assistant1 equals a1.ID into p2
from s2 in p2.DefaultIfEmpty()
....
... continuing with more outer joins on the same collections (Schedules -> Personnels)
Could you please give us a feedback on this.
Thanks
|
|
|
Hi Mark, I have replied to Damir and am following up with him for more details on this.
Jeremy |
|