I want to apply join into
command using a column and a variable value.
here's the code (the partial part of the query where I have an issue):
join p in db.user_tests on a.id equals p.test_id into g3
from x3 in g3.DefaultIfEmpty()
This code works, but I also need to filter the db.user_tests
by the user_id. I have that user_id in a variable userId inside the function.
So I decided to write the query as follows:
join p in db.user_tests on a.id equals p.test_id && userId equals p.user_id into g3
from x3 in g3.DefaultIfEmpty()
But I get "Operator && cannot be applied to operands of type long and bool"
error.
I tried with equal
but it throws several errors.
I also tried with the two column join, but I use a variable in the comparison so it doesn't work.
How can I use the join into with a column comparison and a variable at the same time?