다음을 통해 공유


두 시퀀스의 집합 교집합을 반환

연산자를 Intersect 사용하여 두 시퀀스의 집합 교집합을 반환합니다.

예시

이 예제에서는 IntersectCustomers가 모두 거주하는 모든 국가/지역의 시퀀스를 반환하기 위해 Employees를 사용합니다.

var infoQuery =
    (from cust in db.Customers
    select cust.Country)
    .Intersect
        (from emp in db.Employees
        select emp.Country)
;
Dim infoQuery = _
    (From cust In db.Customers _
     Select cust.Country) _
    .Intersect _
        (From emp In db.Employees _
         Select emp.Country)

LINQ to SQL에서 Intersect 작업은 집합에서만 잘 정의됩니다. 다중 세트의 의미 체계는 정의되지 않습니다.

참고하십시오