Morelinq and LINQ

Source: Internet
Author: User

Morelinq's batch and partition don't know what the difference is.

var ints =enumerable.range (1,10);
var result = INTs. Batch (3);
var result2 = INTs. Partition (3);

The result is the same as//[1,2,3],[4,5,6],[7,8,9],[10], partition may also specify the size of each partition, but the individual int parameters are really unknown.

-------------------

var ints =enumerable.range (1,10);

var result3 = INTs. Windowed (4);

Windowed a magical method, each element loops 4, [[1,2,3,4],[2,3,4,5],[3,4,5,6]. (Lazy to write) ... [7,8,9,10]]

------------------------------------------

IEnumerable judgment Null (empty means no element list, not null meaning), with no parameter of any (), without the count () efficiency problem, icollection,ilist can also be used.

--------------------------------------------------------------------------------------------------------------- ------

Morelinq plus Exceptby is more than LINQ Except, you can convert elements to key comparisons, and the elements of poor set results are not duplicated, even if there are duplicates in the original list.

Internal use of Set or HashSet to do the comparison.

-------------------------------------------------------------------

Enumerable.empty<titem> is a single static class, should be not a type to save one, return is actually titem[0]

Morelinq and LINQ

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.