2

What is valid Linq Statement for

from a in Active_SLA 
where a.APP_ID == (from f in FORM_PAGES where f.PAGE_ADDRESS == @Address select f.APP_ID)
    && a.PERSON_ID == (from p in PERSON_DEVICES where p.DEVICE_NUMBER == @number select p.PERSON_ID) 
select a.PRIORITY

1 Answer 1

2

Rather than nested queries, you should use join statements to combine tables based on matching columns.

In your example, the proper Linq query would look something like this:

from a in Active_SLA
join f in FORM_PAGES on a.APP_ID equals f.APP_ID
join p in PERSON_DEVICES on a.PERSON_ID equals p.PERSON_ID
where (f.PAGE_ADDRESS == @Address) && (p.DEVICE_NUMBER == @number)
select a.PRIORITY;

Hope that helps!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.