Learn how to use LINQ in your applications with these code samples, covering the entire range of LINQ functionality and demonstrating LINQ to objects, and LINQ to XML.
Learn how to generate a single value from a sequence
Combine multiple sequences into a single source sequence.
Convert sequences of one type into another.
Learn how to build seqeunces from multiple inputs.
Use the index of items in a sequence during a query.
Compare sequences for equality.
Generate sequences by running a query.
Group items into sub-sequences.
Combine multiple sequences into a single sequence by matching values on properties.
Sort sequences.
Transform sequences into new types.
Test for all or any elements matching a condition.
Learn about deferred and immediate query execution.
Filter sequences using Where
.
Learn about set operations such as Distinct
, Except
, Intersect
,
and Union
.
. To build and run the sample, type the following two commands in any of the subdirectories:
dotnet restore
dotnet run
dotnet restore
restores the dependencies for this sample.
dotnet run
builds the sample and runs the output assembly.
[!INCLUDEDotNet Restore Note]