Linq selecting items that exist in both list

后端 未结 2 583
北恋
北恋 2021-01-17 07:11

I have 2 list:

myObject object1 = new myObject(id = 1, title = \"object1\"};
myObject object2 = new myObject(id = 2, title = \"object2\"};
myObject object3 =         


        
2条回答
  •  囚心锁ツ
    2021-01-17 08:07

    IEnumerable matches = myObjectList.Join(
        idList,
        o => o.Id,
        id => id,
        (o, id) => o);
    

提交回复
热议问题