Generate API docs as markdown

This commit is contained in:
Jordan Wages 2026-07-07 01:56:58 -05:00
commit 85e90f7bd5
120 changed files with 14227 additions and 76482 deletions

View file

@ -2,11 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<title>Class LINQExtensions | CapyKit Documentation </title>
<title> Class LINQExtensions | CapyKit Documentation </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class LINQExtensions | CapyKit Documentation ">
<meta name="title" content=" Class LINQExtensions | CapyKit Documentation ">
<meta name="description" content="Provides static extension methods for performing common LINQ operations on and collections.">
<link rel="icon" href="../favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
@ -39,7 +39,7 @@
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
@ -70,600 +70,226 @@
<nav id="breadcrumb"></nav>
</div>
<article data-uid="CapyKit.Extensions.LINQExtensions">
<h1 id="CapyKit_Extensions_LINQExtensions" data-uid="CapyKit.Extensions.LINQExtensions" class="text-break">
Class LINQExtensions
</h1>
<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="CapyKit.html">CapyKit</a>.<a class="xref" href="CapyKit.Extensions.html">Extensions</a></dd></dl>
<dl><dt>Assembly</dt><dd>CapyKit.dll</dd></dl>
</div>
<div class="markdown summary"><p>Provides static extension methods for performing common LINQ operations on <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a> and <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable&lt;T&gt;</a> collections.</p>
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class LINQExtensions</code></pre>
</div>
<dl class="typelist inheritance">
<dt>Inheritance</dt>
<dd>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
<div><span class="xref">LINQExtensions</span></div>
</dd>
</dl>
<dl class="typelist inheritedMembers">
<dt>Inherited Members</dt>
<dd>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
</div>
</dd></dl>
<h2 class="section" id="methods">Methods
</h2>
<a id="CapyKit_Extensions_LINQExtensions_Distinct_" data-uid="CapyKit.Extensions.LINQExtensions.Distinct*"></a>
<h3 id="CapyKit_Extensions_LINQExtensions_Distinct__2_System_Collections_Generic_IEnumerable___0__System_Func___0___1__" data-uid="CapyKit.Extensions.LINQExtensions.Distinct``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``1})">
Distinct&lt;T, U&gt;(IEnumerable&lt;T&gt;, Func&lt;T, U&gt;)
</h3>
<div class="markdown level1 summary"><p>Enumerates distinct items in this collection as defined by the key <code class="paramref">property</code>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; Distinct&lt;T, U&gt;(this IEnumerable&lt;T&gt; items, Func&lt;T, U&gt; property)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>items</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</dt>
<dd><p>The items to act on.</p>
</dd>
<dt><code>property</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, U&gt;</dt>
<dd><p>The property.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</dt>
<dd><p>An enumerator that allows foreach to be used to process distinct items in this collection.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>Generic type parameter of the parent object.</p>
</dd>
<dt><code>U</code></dt>
<dd><p>Generic type parameter property value.</p>
</dd>
</dl>
<a id="CapyKit_Extensions_LINQExtensions_Filter_" data-uid="CapyKit.Extensions.LINQExtensions.Filter*"></a>
<h3 id="CapyKit_Extensions_LINQExtensions_Filter__1_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Boolean__" data-uid="CapyKit.Extensions.LINQExtensions.Filter``1(System.Collections.Generic.IEnumerable{``0},System.Func{``0,System.Boolean})">
Filter&lt;T&gt;(IEnumerable&lt;T&gt;, Func&lt;T, bool&gt;)
</h3>
<div class="markdown level1 summary"><p>Filters out items matching a <code class="paramref">predicate</code> from the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; Filter&lt;T&gt;(this IEnumerable&lt;T&gt; source, Func&lt;T, bool&gt; predicate)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</dt>
<dd><p>The source to act on.</p>
</dd>
<dt><code>predicate</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>&gt;</dt>
<dd><p>The predicate.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</dt>
<dd><p>An enumerator that allows foreach to be used to process remove in this collection.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
</dl>
<a id="CapyKit_Extensions_LINQExtensions_Filter_" data-uid="CapyKit.Extensions.LINQExtensions.Filter*"></a>
<h3 id="CapyKit_Extensions_LINQExtensions_Filter__1_System_Linq_IQueryable___0__System_Linq_Expressions_Expression_System_Func___0_System_Boolean___" data-uid="CapyKit.Extensions.LINQExtensions.Filter``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
Filter&lt;T&gt;(IQueryable&lt;T&gt;, Expression&lt;Func&lt;T, bool&gt;&gt;)
</h3>
<div class="markdown level1 summary"><p>Filters out items matching a <code class="paramref">predicate</code> from the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IQueryable&lt;T&gt; Filter&lt;T&gt;(this IQueryable&lt;T&gt; source, Expression&lt;Func&lt;T, bool&gt;&gt; predicate)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</dt>
<dd><p>The source to act on.</p>
</dd>
<dt><code>predicate</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1">Expression</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>&gt;&gt;</dt>
<dd><p>The predicate.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</dt>
<dd><p>An enumerator that allows foreach to be used to process remove in this collection.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
</dl>
<a id="CapyKit_Extensions_LINQExtensions_LeftOuterJoin_" data-uid="CapyKit.Extensions.LINQExtensions.LeftOuterJoin*"></a>
<h3 id="CapyKit_Extensions_LINQExtensions_LeftOuterJoin__4_System_Collections_Generic_IEnumerable___0__System_Collections_Generic_IEnumerable___1__System_Func___0___2__System_Func___1___2__System_Func___0_System_Collections_Generic_IEnumerable___1____3__System_Func___0___1__" data-uid="CapyKit.Extensions.LINQExtensions.LeftOuterJoin``4(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1},System.Func{``0,``2},System.Func{``1,``2},System.Func{``0,System.Collections.Generic.IEnumerable{``1},``3},System.Func{``0,``1})">
LeftOuterJoin&lt;T, U, TKey, R&gt;(IEnumerable&lt;T&gt;, IEnumerable&lt;U&gt;, Func&lt;T, TKey&gt;, Func&lt;U, TKey&gt;, Func&lt;T, IEnumerable&lt;U&gt;, R&gt;, Func&lt;T, U&gt;)
</h3>
<div class="markdown level1 summary"><p>An IEnumable&lt;T&gt; extension method that left outer join.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IEnumerable&lt;R&gt; LeftOuterJoin&lt;T, U, TKey, R&gt;(this IEnumerable&lt;T&gt; source, IEnumerable&lt;U&gt; inner, Func&lt;T, TKey&gt; outerSelector, Func&lt;U, TKey&gt; innerSelector, Func&lt;T, IEnumerable&lt;U&gt;, R&gt; resultSelector, Func&lt;T, U&gt; defaultGenerator = null)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</dt>
<dd><p>The source to act on.</p>
</dd>
<dt><code>inner</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;U&gt;</dt>
<dd><p>The inner.</p>
</dd>
<dt><code>outerSelector</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, TKey&gt;</dt>
<dd><p>The outer selector.</p>
</dd>
<dt><code>innerSelector</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;U, TKey&gt;</dt>
<dd><p>The inner selector.</p>
</dd>
<dt><code>resultSelector</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a>&lt;T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;U&gt;, R&gt;</dt>
<dd><p>The result selector.</p>
</dd>
<dt><code>defaultGenerator</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, U&gt;</dt>
<dd><p>(Optional) The default generator.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;R&gt;</dt>
<dd><p>An enumerator that allows foreach to be used to process left outter join in this collection.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
<dt><code>U</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
<dt><code>TKey</code></dt>
<dd><p>Type of the key.</p>
</dd>
<dt><code>R</code></dt>
<dd><p>Type of the r.</p>
</dd>
</dl>
<a id="CapyKit_Extensions_LINQExtensions_LeftOuterJoin_" data-uid="CapyKit.Extensions.LINQExtensions.LeftOuterJoin*"></a>
<h3 id="CapyKit_Extensions_LINQExtensions_LeftOuterJoin__4_System_Linq_IQueryable___0__System_Linq_IQueryable___1__System_Linq_Expressions_Expression_System_Func___0___2___System_Linq_Expressions_Expression_System_Func___1___2___System_Func___0_System_Collections_Generic_IEnumerable___1____3__System_Func___0___1__" data-uid="CapyKit.Extensions.LINQExtensions.LeftOuterJoin``4(System.Linq.IQueryable{``0},System.Linq.IQueryable{``1},System.Linq.Expressions.Expression{System.Func{``0,``2}},System.Linq.Expressions.Expression{System.Func{``1,``2}},System.Func{``0,System.Collections.Generic.IEnumerable{``1},``3},System.Func{``0,``1})">
LeftOuterJoin&lt;T, U, TKey, R&gt;(IQueryable&lt;T&gt;, IQueryable&lt;U&gt;, Expression&lt;Func&lt;T, TKey&gt;&gt;, Expression&lt;Func&lt;U, TKey&gt;&gt;, Func&lt;T, IEnumerable&lt;U&gt;, R&gt;, Func&lt;T, U&gt;)
</h3>
<div class="markdown level1 summary"><p>An IQueryable&lt;T&gt; extension method that left outer join.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IQueryable&lt;R&gt; LeftOuterJoin&lt;T, U, TKey, R&gt;(this IQueryable&lt;T&gt; source, IQueryable&lt;U&gt; inner, Expression&lt;Func&lt;T, TKey&gt;&gt; outerSelector, Expression&lt;Func&lt;U, TKey&gt;&gt; innerSelector, Func&lt;T, IEnumerable&lt;U&gt;, R&gt; resultSelector, Func&lt;T, U&gt; defaultGenerator = null)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</dt>
<dd><p>The source to act on.</p>
</dd>
<dt><code>inner</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;U&gt;</dt>
<dd><p>The inner.</p>
</dd>
<dt><code>outerSelector</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1">Expression</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, TKey&gt;&gt;</dt>
<dd><p>The outer selector.</p>
</dd>
<dt><code>innerSelector</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1">Expression</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;U, TKey&gt;&gt;</dt>
<dd><p>The inner selector.</p>
</dd>
<dt><code>resultSelector</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a>&lt;T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;U&gt;, R&gt;</dt>
<dd><p>The result selector.</p>
</dd>
<dt><code>defaultGenerator</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, U&gt;</dt>
<dd><p>(Optional) The default generator.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;R&gt;</dt>
<dd><p>An IQueryable&lt;R&gt;</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
<dt><code>U</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
<dt><code>TKey</code></dt>
<dd><p>Type of the key.</p>
</dd>
<dt><code>R</code></dt>
<dd><p>Type of the r.</p>
</dd>
</dl>
<a id="CapyKit_Extensions_LINQExtensions_PageCount_" data-uid="CapyKit.Extensions.LINQExtensions.PageCount*"></a>
<h3 id="CapyKit_Extensions_LINQExtensions_PageCount__1_System_Collections_Generic_IEnumerable___0__System_Int32_" data-uid="CapyKit.Extensions.LINQExtensions.PageCount``1(System.Collections.Generic.IEnumerable{``0},System.Int32)">
PageCount&lt;T&gt;(IEnumerable&lt;T&gt;, int)
</h3>
<div class="markdown level1 summary"><p>The number of pages of <code class="paramref">pageSize</code> size in the given collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static int PageCount&lt;T&gt;(this IEnumerable&lt;T&gt; source, int pageSize)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</dt>
<dd><p>The source to act on.</p>
</dd>
<dt><code>pageSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>Size of the page.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>An int.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
</dl>
<h4 class="section">Exceptions</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></dt>
<dd><p>Thrown when <code class="paramref">pageSize</code> is less than <code>1</code>.</p>
</dd>
</dl>
<a id="CapyKit_Extensions_LINQExtensions_PageCount_" data-uid="CapyKit.Extensions.LINQExtensions.PageCount*"></a>
<h3 id="CapyKit_Extensions_LINQExtensions_PageCount__1_System_Linq_IQueryable___0__System_Int32_" data-uid="CapyKit.Extensions.LINQExtensions.PageCount``1(System.Linq.IQueryable{``0},System.Int32)">
PageCount&lt;T&gt;(IQueryable&lt;T&gt;, int)
</h3>
<div class="markdown level1 summary"><p>The number of pages of <code class="paramref">pageSize</code> size in the given collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static int PageCount&lt;T&gt;(this IQueryable&lt;T&gt; source, int pageSize)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</dt>
<dd><p>The source to act on.</p>
</dd>
<dt><code>pageSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>Size of the page.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>An int.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
</dl>
<h4 class="section">Exceptions</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></dt>
<dd><p>Thrown when <code class="paramref">pageSize</code> is less than <code>1</code>.</p>
</dd>
</dl>
<a id="CapyKit_Extensions_LINQExtensions_Page_" data-uid="CapyKit.Extensions.LINQExtensions.Page*"></a>
<h3 id="CapyKit_Extensions_LINQExtensions_Page__1_System_Collections_Generic_IEnumerable___0__System_Int32_System_Int32_" data-uid="CapyKit.Extensions.LINQExtensions.Page``1(System.Collections.Generic.IEnumerable{``0},System.Int32,System.Int32)">
Page&lt;T&gt;(IEnumerable&lt;T&gt;, int, int)
</h3>
<div class="markdown level1 summary"><p>Get a page of items from a collection, skipping <code class="paramref">pageNumber</code> pages of
<article data-uid="">
<h1 id="CapyKit_Extensions_LINQExtensions"> Class LINQExtensions</h1>
<p>Namespace: <a href="CapyKit.Extensions.html">CapyKit.Extensions</a><br>
Assembly: CapyKit.dll</p>
<p>Provides static extension methods for performing common LINQ operations on <span class="xref">System.Collections.Generic.IEnumerable`1</span> and <span class="xref">System.Linq.IQueryable`1</span> collections.</p>
<pre><code class="lang-csharp">public static class LINQExtensions
</code></pre>
<h4 id="inheritance">Inheritance</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a>
<a href="CapyKit.Extensions.LINQExtensions.html">LINQExtensions</a></p>
<h4 id="inherited-members">Inherited Members</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a></p>
<h4 id="extension-methods">Extension Methods</h4>
<p><a href="CapyKit.Extensions.ObjectExtensions.html#CapyKit_Extensions_ObjectExtensions_UpdateProperties_System_Object_System_Object_">ObjectExtensions.UpdateProperties(object, object)</a></p>
<h2 id="methods">Methods</h2>
<h3 id="CapyKit_Extensions_LINQExtensions_Distinct__2_System_Collections_Generic_IEnumerable___0__System_Func___0___1__"> Distinct&lt;T, U&gt;(IEnumerable&lt;T&gt;, Func&lt;T, U&gt;)</h3>
<p>Enumerates distinct items in this collection as defined by the key <code class="paramref">property</code>.</p>
<pre><code class="lang-csharp">public static IEnumerable&lt;T&gt; Distinct&lt;T, U&gt;(this IEnumerable&lt;T&gt; items, Func&lt;T, U&gt; property)
</code></pre>
<h4 id="parameters">Parameters</h4>
<p><code>items</code> <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</p>
<p>The items to act on.</p>
<p><code>property</code> <a href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, U&gt;</p>
<p>The property.</p>
<h4 id="returns">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</p>
<p>An enumerator that allows foreach to be used to process distinct items in this collection.</p>
<h4 id="type-parameters">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter of the parent object.</p>
<p><code>U</code></p>
<p>Generic type parameter property value.</p>
<h3 id="CapyKit_Extensions_LINQExtensions_Filter__1_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Boolean__"> Filter&lt;T&gt;(IEnumerable&lt;T&gt;, Func&lt;T, bool&gt;)</h3>
<p>Filters out items matching a <code class="paramref">predicate</code> from the collection.</p>
<pre><code class="lang-csharp">public static IEnumerable&lt;T&gt; Filter&lt;T&gt;(this IEnumerable&lt;T&gt; source, Func&lt;T, bool&gt; predicate)
</code></pre>
<h4 id="parameters-1">Parameters</h4>
<p><code>source</code> <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</p>
<p>The source to act on.</p>
<p><code>predicate</code> <a href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, <a href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>&gt;</p>
<p>The predicate.</p>
<h4 id="returns-1">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</p>
<p>An enumerator that allows foreach to be used to process remove in this collection.</p>
<h4 id="type-parameters-1">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
<h3 id="CapyKit_Extensions_LINQExtensions_Filter__1_System_Linq_IQueryable___0__System_Linq_Expressions_Expression_System_Func___0_System_Boolean___"> Filter&lt;T&gt;(IQueryable&lt;T&gt;, Expression&lt;Func&lt;T, bool&gt;&gt;)</h3>
<p>Filters out items matching a <code class="paramref">predicate</code> from the collection.</p>
<pre><code class="lang-csharp">public static IQueryable&lt;T&gt; Filter&lt;T&gt;(this IQueryable&lt;T&gt; source, Expression&lt;Func&lt;T, bool&gt;&gt; predicate)
</code></pre>
<h4 id="parameters-2">Parameters</h4>
<p><code>source</code> <a href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</p>
<p>The source to act on.</p>
<p><code>predicate</code> <a href="https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1">Expression</a>&lt;<a href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, <a href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>&gt;&gt;</p>
<p>The predicate.</p>
<h4 id="returns-2">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</p>
<p>An enumerator that allows foreach to be used to process remove in this collection.</p>
<h4 id="type-parameters-2">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
<h3 id="CapyKit_Extensions_LINQExtensions_LeftOuterJoin__4_System_Linq_IQueryable___0__System_Linq_IQueryable___1__System_Linq_Expressions_Expression_System_Func___0___2___System_Linq_Expressions_Expression_System_Func___1___2___System_Func___0_System_Collections_Generic_IEnumerable___1____3__System_Func___0___1__"> LeftOuterJoin&lt;T, U, TKey, R&gt;(IQueryable&lt;T&gt;, IQueryable&lt;U&gt;, Expression&lt;Func&lt;T, TKey&gt;&gt;, Expression&lt;Func&lt;U, TKey&gt;&gt;, Func&lt;T, IEnumerable&lt;U&gt;, R&gt;, Func&lt;T, U&gt;)</h3>
<p>An IQueryable&lt;T&gt; extension method that left outer join.</p>
<pre><code class="lang-csharp">public static IQueryable&lt;R&gt; LeftOuterJoin&lt;T, U, TKey, R&gt;(this IQueryable&lt;T&gt; source, IQueryable&lt;U&gt; inner, Expression&lt;Func&lt;T, TKey&gt;&gt; outerSelector, Expression&lt;Func&lt;U, TKey&gt;&gt; innerSelector, Func&lt;T, IEnumerable&lt;U&gt;, R&gt; resultSelector, Func&lt;T, U&gt; defaultGenerator = null)
</code></pre>
<h4 id="parameters-3">Parameters</h4>
<p><code>source</code> <a href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</p>
<p>The source to act on.</p>
<p><code>inner</code> <a href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;U&gt;</p>
<p>The inner.</p>
<p><code>outerSelector</code> <a href="https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1">Expression</a>&lt;<a href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, TKey&gt;&gt;</p>
<p>The outer selector.</p>
<p><code>innerSelector</code> <a href="https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1">Expression</a>&lt;<a href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;U, TKey&gt;&gt;</p>
<p>The inner selector.</p>
<p><code>resultSelector</code> <a href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a>&lt;T, <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;U&gt;, R&gt;</p>
<p>The result selector.</p>
<p><code>defaultGenerator</code> <a href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, U&gt;</p>
<p>(Optional) The default generator.</p>
<h4 id="returns-3">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;R&gt;</p>
<p>An IQueryable&lt;R&gt;</p>
<h4 id="type-parameters-3">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
<p><code>U</code></p>
<p>Generic type parameter.</p>
<p><code>TKey</code></p>
<p>Type of the key.</p>
<p><code>R</code></p>
<p>Type of the r.</p>
<h3 id="CapyKit_Extensions_LINQExtensions_LeftOuterJoin__4_System_Collections_Generic_IEnumerable___0__System_Collections_Generic_IEnumerable___1__System_Func___0___2__System_Func___1___2__System_Func___0_System_Collections_Generic_IEnumerable___1____3__System_Func___0___1__"> LeftOuterJoin&lt;T, U, TKey, R&gt;(IEnumerable&lt;T&gt;, IEnumerable&lt;U&gt;, Func&lt;T, TKey&gt;, Func&lt;U, TKey&gt;, Func&lt;T, IEnumerable&lt;U&gt;, R&gt;, Func&lt;T, U&gt;)</h3>
<p>An IEnumable&lt;T&gt; extension method that left outer join.</p>
<pre><code class="lang-csharp">public static IEnumerable&lt;R&gt; LeftOuterJoin&lt;T, U, TKey, R&gt;(this IEnumerable&lt;T&gt; source, IEnumerable&lt;U&gt; inner, Func&lt;T, TKey&gt; outerSelector, Func&lt;U, TKey&gt; innerSelector, Func&lt;T, IEnumerable&lt;U&gt;, R&gt; resultSelector, Func&lt;T, U&gt; defaultGenerator = null)
</code></pre>
<h4 id="parameters-4">Parameters</h4>
<p><code>source</code> <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</p>
<p>The source to act on.</p>
<p><code>inner</code> <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;U&gt;</p>
<p>The inner.</p>
<p><code>outerSelector</code> <a href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, TKey&gt;</p>
<p>The outer selector.</p>
<p><code>innerSelector</code> <a href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;U, TKey&gt;</p>
<p>The inner selector.</p>
<p><code>resultSelector</code> <a href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a>&lt;T, <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;U&gt;, R&gt;</p>
<p>The result selector.</p>
<p><code>defaultGenerator</code> <a href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, U&gt;</p>
<p>(Optional) The default generator.</p>
<h4 id="returns-4">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;R&gt;</p>
<p>An enumerator that allows foreach to be used to process left outter join in this collection.</p>
<h4 id="type-parameters-4">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
<p><code>U</code></p>
<p>Generic type parameter.</p>
<p><code>TKey</code></p>
<p>Type of the key.</p>
<p><code>R</code></p>
<p>Type of the r.</p>
<h3 id="CapyKit_Extensions_LINQExtensions_Page__1_System_Collections_Generic_IEnumerable___0__System_Int32_System_Int32_"> Page&lt;T&gt;(IEnumerable&lt;T&gt;, int, int)</h3>
<p>Get a page of items from a collection, skipping <code class="paramref">pageNumber</code> pages of
<code class="paramref">pageSize</code> items per page.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; Page&lt;T&gt;(this IEnumerable&lt;T&gt; source, int pageNumber, int pageSize)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</dt>
<dd><p>The source to act on.</p>
</dd>
<dt><code>pageNumber</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The page number to retrieve.</p>
</dd>
<dt><code>pageSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>Number of items per page.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</dt>
<dd><p>An enumerator that allows foreach to be used to process page in this collection.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
</dl>
<h4 class="section" id="CapyKit_Extensions_LINQExtensions_Page__1_System_Collections_Generic_IEnumerable___0__System_Int32_System_Int32__remarks">Remarks</h4>
<div class="markdown level1 remarks"><p>This method uses natural numbering starting at page 1.</p>
</div>
<h4 class="section">Exceptions</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></dt>
<dd><p>Thrown when <code class="paramref">pageNumber</code> is less than <code>1</code> or if
<pre><code class="lang-csharp">public static IEnumerable&lt;T&gt; Page&lt;T&gt;(this IEnumerable&lt;T&gt; source, int pageNumber, int pageSize)
</code></pre>
<h4 id="parameters-5">Parameters</h4>
<p><code>source</code> <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</p>
<p>The source to act on.</p>
<p><code>pageNumber</code> <a href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></p>
<p>The page number to retrieve.</p>
<p><code>pageSize</code> <a href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></p>
<p>Number of items per page.</p>
<h4 id="returns-5">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</p>
<p>An enumerator that allows foreach to be used to process page in this collection.</p>
<h4 id="type-parameters-5">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
<h4 id="remarks">Remarks</h4>
<p>This method uses natural numbering starting at page 1.</p>
<h4 id="exceptions">Exceptions</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></p>
<p>Thrown when <code class="paramref">pageNumber</code> is less than <code>1</code> or if
<code class="paramref">pageSize</code> is less than
<code>1</code>.</p>
</dd>
</dl>
<a id="CapyKit_Extensions_LINQExtensions_Page_" data-uid="CapyKit.Extensions.LINQExtensions.Page*"></a>
<h3 id="CapyKit_Extensions_LINQExtensions_Page__1_System_Linq_IQueryable___0__System_Int32_System_Int32_" data-uid="CapyKit.Extensions.LINQExtensions.Page``1(System.Linq.IQueryable{``0},System.Int32,System.Int32)">
Page&lt;T&gt;(IQueryable&lt;T&gt;, int, int)
</h3>
<div class="markdown level1 summary"><p>Get a page of items from a collection, skipping <code class="paramref">pageNumber</code> pages of
<h3 id="CapyKit_Extensions_LINQExtensions_Page__1_System_Linq_IQueryable___0__System_Int32_System_Int32_"> Page&lt;T&gt;(IQueryable&lt;T&gt;, int, int)</h3>
<p>Get a page of items from a collection, skipping <code class="paramref">pageNumber</code> pages of
<code class="paramref">pageSize</code> items per page.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IQueryable&lt;T&gt; Page&lt;T&gt;(this IQueryable&lt;T&gt; source, int pageNumber, int pageSize)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</dt>
<dd><p>The source to act on.</p>
</dd>
<dt><code>pageNumber</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The page number to retrieve.</p>
</dd>
<dt><code>pageSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</dt>
<dd><p>An enumerator that allows foreach to be used to process page in this collection.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>Generic type parameter.</p>
</dd>
</dl>
<h4 class="section" id="CapyKit_Extensions_LINQExtensions_Page__1_System_Linq_IQueryable___0__System_Int32_System_Int32__remarks">Remarks</h4>
<div class="markdown level1 remarks"><p>This method uses natural numbering starting at page 1.</p>
</div>
<h4 class="section">Exceptions</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></dt>
<dd><p>Thrown when <code class="paramref">pageNumber</code> is less than <code>1</code> or if
<pre><code class="lang-csharp">public static IQueryable&lt;T&gt; Page&lt;T&gt;(this IQueryable&lt;T&gt; source, int pageNumber, int pageSize)
</code></pre>
<h4 id="parameters-6">Parameters</h4>
<p><code>source</code> <a href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</p>
<p>The source to act on.</p>
<p><code>pageNumber</code> <a href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></p>
<p>The page number to retrieve.</p>
<p><code>pageSize</code> <a href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></p>
<p>.</p>
<h4 id="returns-6">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</p>
<p>An enumerator that allows foreach to be used to process page in this collection.</p>
<h4 id="type-parameters-6">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
<h4 id="remarks-1">Remarks</h4>
<p>This method uses natural numbering starting at page 1.</p>
<h4 id="exceptions-1">Exceptions</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></p>
<p>Thrown when <code class="paramref">pageNumber</code> is less than <code>1</code> or if
<code class="paramref">pageSize</code> is less than
<code>1</code>.</p>
</dd>
</dl>
<h3 id="CapyKit_Extensions_LINQExtensions_PageCount__1_System_Collections_Generic_IEnumerable___0__System_Int32_"> PageCount&lt;T&gt;(IEnumerable&lt;T&gt;, int)</h3>
<p>The number of pages of <code class="paramref">pageSize</code> size in the given collection.</p>
<pre><code class="lang-csharp">public static int PageCount&lt;T&gt;(this IEnumerable&lt;T&gt; source, int pageSize)
</code></pre>
<h4 id="parameters-7">Parameters</h4>
<p><code>source</code> <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</p>
<p>The source to act on.</p>
<p><code>pageSize</code> <a href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></p>
<p>Size of the page.</p>
<h4 id="returns-7">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></p>
<p>An int.</p>
<h4 id="type-parameters-7">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
<h4 id="exceptions-2">Exceptions</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></p>
<p>Thrown when <code class="paramref">pageSize</code> is less than <code>1</code>.</p>
<h3 id="CapyKit_Extensions_LINQExtensions_PageCount__1_System_Linq_IQueryable___0__System_Int32_"> PageCount&lt;T&gt;(IQueryable&lt;T&gt;, int)</h3>
<p>The number of pages of <code class="paramref">pageSize</code> size in the given collection.</p>
<pre><code class="lang-csharp">public static int PageCount&lt;T&gt;(this IQueryable&lt;T&gt; source, int pageSize)
</code></pre>
<h4 id="parameters-8">Parameters</h4>
<p><code>source</code> <a href="https://learn.microsoft.com/dotnet/api/system.linq.iqueryable-1">IQueryable</a>&lt;T&gt;</p>
<p>The source to act on.</p>
<p><code>pageSize</code> <a href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></p>
<p>Size of the page.</p>
<h4 id="returns-8">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></p>
<p>An int.</p>
<h4 id="type-parameters-8">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
<h4 id="exceptions-3">Exceptions</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></p>
<p>Thrown when <code class="paramref">pageSize</code> is less than <code>1</code>.</p>
</article>
<div class="contribution d-print-none">
</div>
<div class="next-article d-print-none border-top" id="nextArticle"></div>
</div>