Linq to Objects

Source: Internet
Author: User

Query operators:

where operator

Projection operator: Select, SelectMany

Sort operators:

Orderbydescending,thenby,thenbydescending must first use the order before using ThenBy,

Reverse operator: Reverses the results of the query

Grouping operator: GroupBy

Join operator: Join,groupjoin

Set Operator:

DISTINCT: Removing duplicates

Union: Enumerates the first and second series sequentially, with the same non-repeating enumeration in the second sequence as in the first sequence

Intersect: produces only the elements in two sequences, taking the intersection

Except: Occurs in all elements in the first sequence that do not appear in the second sequence, and excludes all elements contained in the second sequence in the first sequence

Aggregation operators:

Sum: Sum

Min: Minimum value

Max: Max value

Average: Average

Aggregate: Cumulative

Build operator:

Range:

Repeat:

Quantifier operators:

Any: exists, existence returns true otherwise returns false

All: If all items meet the filter criteria, all elements conform to return true otherwise return false

Contains: Whether it contains

Partitioning operators:

Take: Returns the value of the specified sequence length by querying the top n items

TakeWhile:

Skip:

SkipWhile:

Element operator:

First:

FirstOrDefault:

Last:

LastOrDefault:

Single: Select a specific and unique item from the meta sequence

Singleordefault:

ElementAt: Extracting specific items from a sequence

Elementatordefault:

Defaultorempty: Returns a default element for an empty sequence, a left-hand inoculation, which can be assigned a default value in place of a possible null value

Other operators:

Contact: Appends a sequence to another sequence, in series

SequenceEqual: Compares each item in the first sequence to an item in the second sequence, if the number of two series items, the content, the position are the same, is considered equal

Conversion operators:

AsEnumerable: Returning the source sequence to an object of type ienumerable<tsource>

Tolist/toarray:

ToDictionary: The first argument of the operator is the keyselector predicate and is used as the key. ToDictionary (C=>c.name, C=>new{c.name, c.city});

ToLookup:

Oftype/cast: Filter/convert source sequence and generate TResult type

  

Linq to Objects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.