1

Tried this :

myStructs = from MyObject s in MyObjects
            join c in Categories on s.CategoryID equals c.Item1 && s.Stars equals c.Item2
            select s;

but seems I can't wrote 2 condition at the join? Where am I wrong? On SQL this can be done as well...

markzzz
  • 47,390
  • 120
  • 299
  • 507

1 Answers1

2

You need an anonymous type to join on multiple conditions/fields:

myStructs = from s in MyObjects
            join c in Categories 
            on new { s.CategoryID, s.Stars }  equals new { CategoryID = c.Item1, Stars = c.Item2 }
            select s;
Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939