Project Icon

SuperLinq

LINQ功能增强库 扩展数据处理能力

SuperLinq是一个开源项目,扩展了LINQ to Objects的功能。它为IEnumerable<T>和IAsyncEnumerable<T>提供额外实用方法,增加了排序、集合操作、过滤和投影等新功能。保持LINQ设计理念的同时,SuperLinq通过NuGet包集成,增强了开发者处理数据序列的能力。

SuperLinq

NameStatusHistory
GitHub ActionsBuildGitHub Actions Build History

GitHub release GitHub license GitHub issues GitHub issues-closed

LINQ to Objects is missing a few desirable features.

This project enhances LINQ to Objects with extra methods, in a manner which keeps to the spirit of LINQ.

Methods are provided to extend both IEnumerable<T> (via SuperLinq package) and IAsyncEnumerable<T> (via SuperLinq.Async package).

SuperLinq

SuperLinq is available for download and installation as a NuGet package. NuGet Badge

The documentation for the SuperLinq methods can be found here.

SuperLinq.Async

SuperLinq.Async is available for download and installation as a NuGet package. NuGet Badge

The documentation for the SuperLinq.Async methods can be found here.

Operators

Sorting Data

A sorting operation orders the elements of a sequence based on one or more attributes. The first sort criterion performs a primary sort on the elements. By specifying a second sort criterion, you can sort the elements within each primary sort group.

Methods

Method NameDescriptionSync docAsync doc
OrderBySorts the elements of a sequence in a particular direction (ascending, descending) according to a keylinklink
ThenByPerforms a subsequent ordering of elements in a sequence in a particular direction (ascending, descending) according to a keylinklink
PartialSortExecutes a partial sort of the top N elements of a sequence. If N is less than the total number of elements in the sequence, then this method will improve performance.linklink
PartialSortByExecutes a partial sort of the top N elements of a sequence according to a key. If N is less than the total number of elements in the sequence, then this method will improve performance.linklink
DensePartialSortExecutes a partial sort of the top N elements of a sequence, including ties. If N is less than the total number of elements in the sequence, then this method will improve performance.linklink
DensePartialSortByExecutes a partial sort of the top N elements of a sequence, including ties according to a key. If N is less than the total number of elements in the sequence, then this method will improve performance.linklink
ShuffleSorts the elements of a sequence in a random order.link⏱(#20)
RandomSubsetSorts a given number of elements of a sequence in a random order.link⏱(#20)
Set Operations

Set operations in LINQ refer to query operations that produce a result set that is based on the presence or absence of equivalent elements within the same or separate collections (or sets).

Methods

Method NameDescriptionSync docAsync doc
DistinctByRemoves duplicate values from a collection.linklink
DuplicatesReturns the sequence of elements that are in the source sequence more than once.linklink
ExceptByReturns the set difference, which means the elements of one collection that do not appear in a second collection.linklink
Filtering Data

Filtering refers to the operation of restricting the result set to contain only those elements that satisfy a specified condition. It is also known as selection.

Methods

Method NameDescriptionSync docAsync doc
ChooseFilters a sequence based on a projection method that returns a tuple containing bool value and a new projected value.linklink
WhereFilters a sequence of values based on an enumeration of boolean values.linklink
WhereLeadFilters a sequence of values based on a predicate evaluated on the current value and a leading value.linklink
WhereLagFilters a sequence of values based on a predicate evaluated on the current value and a lagging value.linklink
Quantifier Operations

Quantifier operations return a boolean value that indicates whether the sequence length matches some criteria.

Methods

Method NameDescriptionSync docAsync doc
AtLeastDetermines whether or not the number of elements in the sequence is greater than or equal to the given integer.linklink
AtMostDetermines whether or not the number of elements in the sequence is lesser than or equal to the given integer.linklink
CountBetweenDetermines whether or not the number of elements in the sequence is between an inclusive range of minimum and maximum integers.linklink
ExactlyDetermines whether or not the number of elements in the sequence is equals to the given integer.linklink
TrySingleDetermines the cardinality of the sequence in the set { 0, 1, >1 }.linklink
HasDuplicatesDetermines whether the sequence contains duplicateslinklink
Projection Operations

Projection refers to the operation of transforming an object into a new form that may contain related information.

Methods

Method NameDescriptionSync docAsync doc
EquiZipJoins the corresponding elements of up to four sequences producing a sequence of tuples containing them, asserting that all sequences have exactly the same length.linklink
ZipLongestJoins the corresponding elements of up to four sequences producing a sequence of tuples containing them, using default values for sequences that are shorter than the longest sequence.linklink
ZipShortestJoins the corresponding elements of up to four sequences producing a sequence of tuples containing them, which has the same length as the shortest sequence.linklink
CountDownProvides a countdown counter for a given count of elements at the tail of the sequence.linklink
TagFirstLastProvides bool values indicating for each element whether it is the first or last element of the sequence.linklink
IndexProvides an int value indicating the current index of each element of the sequence.linklink
IndexByProvides an int value indicating the current index of each element of the sequence within a group of items defined by a common attribute.linklink
LagJoins each element of the sequence with n-th previous element of the same sequence.linklink
LeadJoins each element of the sequence with n-th next element of the same sequence.linklink
RankProvides an int value indicating the current rank of each element of the sequence.linklink
RankByProvides an int value indicating the current rank of each element of the sequence according to a key.linklink
DenseRankProvides an int value indicating the current rank of each element of the sequence, counting ties as a single element.linklink
DenseRankByProvides an int value indicating the current rank of each element of the sequence according to a key, counting ties as a single element.linklink
EvaluateTransforms a sequence of functions to a sequence of values returned by the functions.linkN/A[^1]
ZipMapApplies a function to each element in a sequence and returns a sequence of tuples containing both the original item as well as the function result.link
项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

吐司

探索Tensor.Art平台的独特AI模型,免费访问各种图像生成与AI训练工具,从Stable Diffusion等基础模型开始,轻松实现创新图像生成。体验前沿的AI技术,推动个人和企业的创新发展。

Project Cover

SubCat字幕猫

SubCat字幕猫APP是一款创新的视频播放器,它将改变您观看视频的方式!SubCat结合了先进的人工智能技术,为您提供即时视频字幕翻译,无论是本地视频还是网络流媒体,让您轻松享受各种语言的内容。

Project Cover

美间AI

美间AI创意设计平台,利用前沿AI技术,为设计师和营销人员提供一站式设计解决方案。从智能海报到3D效果图,再到文案生成,美间让创意设计更简单、更高效。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号