CROSS APPLY

Aug 3, 2016 at 3:50 PM
Hi Roman!

Could you give me, please, help with this problem?

How can I write LINQ equivalent of this T-Sql query?

declare @T table(Energy float, Delta float)

insert into @T(Energy, Delta)
values(137, 5),(157, 5)

select ia.SpectrumId
from IonActivationEnergy ia
cross apply (select * from @T t where ia.NormalizedEnergy>=t.Energy-t.Delta and ia.NormalizedEnergy<=t.Energy+t.Delta) as f

@T table declaration is for demo purpose in fact it is IEnumerable of type (IonActivationEnergyStruct ) which contains two property (Energy and Delta)

I cannot find any solution. Even browse web forums did not help.

Thank you in advance


Milos.
Coordinator
Aug 4, 2016 at 6:15 PM
Hi
Please post on github, let's continue there from now on
Coordinator
Aug 4, 2016 at 10:12 PM
I read a bit about cross apply; there's no support currently for it in VITA, but in many cases it can be replaced with Join. Try and see if it works?