Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
试过这个:
myStructs = from MyObject s in MyObjects join c in Categories on s.CategoryID equals c.Item1 && s.Stars equals c.Item2 select s;
但似乎我不能在加入时写 2 个条件?我哪里错了?在 SQL 上,这也可以完成......
您需要一个匿名类型来加入多个条件/字段:
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;