May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Set operators allow removing duplicates and merge sequences and exclude specified elements. For example you could have duplicate items within a sequence or collection; you can remove duplicates using the Distinct operator. The following provides an example on a simple array of integers:

The result is a new IEnumberable(Of Integer). In real scenarios you could find this operator useful in LINQ to SQL or the Entity Framework for searching duplicate records in a database table. The next operator is Union, which is an extension method and merges two sequences into a new one. The following is an example:
The preceding code returns an ...
Read now
Unlock full access