I have the following SQL:
select Monitor.* from Monitor
left join Queue on Queue.MonitorID = Monitor.MonitorID
and Queue.QueueID = (select top 1 Queue.QueueID from Queue where Queue.MonitorID = Monitor.MonitorID order by Queue.Created)
where Queue.Created is null or Queue.Created < 'DateTimeValue'
This query selects all "Monitors" whose queue is overdue or missing, if you can think of better ways at getting that info that'd be fine too.
The results from this query are overdue items that need to be run. I am using EF6.
I am trying to convert this from SQL to Linq Lambdas, I tried Linqer but it doesn't seem to output Lambda examples or I can't find the setting to make it happen.
So, can someone help guide me in converting this query and offer improvements if there are any? I know subquery is a performance killer...
Once I see it done once I feel like I will be able to learn the syntax.
I'm specifically looking for examples of this join syntax in linq/lambdas
Queue.MonitorID=Monitor.MonitorID?