0

I'm trying to load a list of entities, with 2 conditions which I'm passing with a list of Tuple. See:

private IEnumerable<Invoice> FindInvoices(IEnumerable<Tuple<int, int>> vars) { ... }

Now, I'm having truble to how to join the main entity-set with the input parameters:

private IEnumerable<Invoice> FindInvoices(IEnumerable<Tuple<int, int>> vars) {
    var q = from i in context.Invoices
            join v in vars on 
                i.Prop1 == v.Item1
                // HERE IS THE PROBLEM. THERE IS NO "&&" or "and" to apply:
                && i.Prop2 == v.Item2
}

As you can see, since there is no && or and support, I cannot apply the second condition to clause. So, how can I write a join with 2 conditions in on clause?

OR can you suggest any alternative? Thanks in advance.

amiry jd
  • 27,021
  • 30
  • 116
  • 215
  • Im not sure if this applies to entity framework as well. if it doesn't, my apologies. please let me know so i will retract my vote. – M.kazem Akhgary Jan 13 '19 at 14:26
  • @M.kazemAkhgary Thanks the comment. I found the join answer, but I'm not sure too if it works in linq2ef or not. Ill let you know the result of test. – amiry jd Jan 13 '19 at 14:40

0 Answers0