Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 1.36 KB

sets.md

File metadata and controls

36 lines (20 loc) · 1.36 KB

LINQ - Set Operators

The methods Distinct, Union, Intersect, and Except provide set operations to compare multiple sequences.

Find distinct elements

This sample uses Distinct to remove duplicate elements in a sequence of factors of 300.

Find distinct values of a property

This sample uses Distinct to find the unique Category names.

Find the union of sets

This sample uses Union to create one sequence that contains the unique values from both arrays.

Union of query results

This sample uses Union to create one sequence that contains the unique first letter from both product and customer names. It shows how you can combine the results of two different queries that produce the same element type.

Next: Intersect and except set operations » Previous: Nested groupings with a custom comparer «

Home