Find items from a list which exist in another list

后端 未结 4 361
攒了一身酷
攒了一身酷 2020-12-08 19:13

I have a List

PropA  
{  
    int a;  
    int b;  
}

and another List

         


        
4条回答
  •  心在旅途
    2020-12-08 19:42

    var commonNumbers = first.Intersect(second); 
    

    This will give you the common values between two lists, a much faster and cleaner approach than join or other Lambda expressions.

    Just try it.

    Source : MSDN

提交回复
热议问题