Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apiCount.include.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**API count: 929**
**API count: 930**

### Per Target Framework

Expand Down
1 change: 1 addition & 0 deletions api_list.include.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@
* `TSource? Min<TSource>(IComparer<TSource>?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.min?view=net-11.0#system-linq-enumerable-min-1(system-collections-generic-ienumerable((-0))-system-collections-generic-icomparer((-0))))
* `TSource? MinBy<TSource, TKey>(Func<TSource, TKey>, IComparer<TKey>?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.minby?view=net-11.0#system-linq-enumerable-minby-2(system-collections-generic-ienumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))))
* `TSource? MinBy<TSource, TKey>(Func<TSource, TKey>)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.minby?view=net-11.0#system-linq-enumerable-minby-2(system-collections-generic-ienumerable((-0))-system-func((-0-1))))
* `IEnumerable<TSource> Prepend<TSource>(TSource)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.prepend?view=net-11.0)
* `TSource SingleOrDefault<TSource>(Func<TSource, bool>, TSource)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.singleordefault?view=net-11.0#system-linq-enumerable-singleordefault-1(system-collections-generic-ienumerable((-0))-system-func((-0-system-boolean))-0))
* `TSource SingleOrDefault<TSource>(TSource)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.singleordefault?view=net-11.0#system-linq-enumerable-singleordefault-1(system-collections-generic-ienumerable((-0))-0))
* `IEnumerable<TSource> SkipLast<TSource>(int)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.skiplast?view=net-11.0)
Expand Down
4 changes: 2 additions & 2 deletions assemblySize.include.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| netstandard2.1 | 8.5KB | 258.0KB | +249.5KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net461 | 8.5KB | 303.5KB | +295.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net462 | 7.0KB | 307.0KB | +300.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net47 | 7.0KB | 307.0KB | +300.0KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB |
| net47 | 7.0KB | 307.0KB | +300.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net471 | 8.5KB | 306.5KB | +298.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net472 | 8.5KB | 305.5KB | +297.0KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB |
| net48 | 8.5KB | 305.5KB | +297.0KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB |
Expand All @@ -33,7 +33,7 @@
| netstandard2.1 | 8.5KB | 372.0KB | +363.5KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net461 | 8.5KB | 443.8KB | +435.3KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net462 | 7.0KB | 447.3KB | +440.3KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net47 | 7.0KB | 447.0KB | +440.0KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB |
| net47 | 7.0KB | 447.0KB | +440.0KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net471 | 8.5KB | 446.2KB | +437.7KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net472 | 8.5KB | 444.1KB | +435.6KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB |
| net48 | 8.5KB | 444.1KB | +435.6KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB |
Expand Down
7 changes: 4 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The package targets `netstandard2.0` and is designed to support the following ru
* `uap10`


**API count: 929**<!-- include: apiCount. path: /apiCount.include.md -->
**API count: 930**<!-- include: apiCount. path: /apiCount.include.md -->

### Per Target Framework

Expand Down Expand Up @@ -100,7 +100,7 @@ This project uses features from the current stable SDK and C# language. As such
| netstandard2.1 | 8.5KB | 258.0KB | +249.5KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net461 | 8.5KB | 303.5KB | +295.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net462 | 7.0KB | 307.0KB | +300.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net47 | 7.0KB | 307.0KB | +300.0KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB |
| net47 | 7.0KB | 307.0KB | +300.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net471 | 8.5KB | 306.5KB | +298.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB |
| net472 | 8.5KB | 305.5KB | +297.0KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB |
| net48 | 8.5KB | 305.5KB | +297.0KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB |
Expand All @@ -127,7 +127,7 @@ This project uses features from the current stable SDK and C# language. As such
| netstandard2.1 | 8.5KB | 372.0KB | +363.5KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net461 | 8.5KB | 443.8KB | +435.3KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net462 | 7.0KB | 447.3KB | +440.3KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net47 | 7.0KB | 447.0KB | +440.0KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB |
| net47 | 7.0KB | 447.0KB | +440.0KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net471 | 8.5KB | 446.2KB | +437.7KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB |
| net472 | 8.5KB | 444.1KB | +435.6KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB |
| net48 | 8.5KB | 444.1KB | +435.6KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB |
Expand Down Expand Up @@ -1022,6 +1022,7 @@ The class `Polyfill` includes the following extension methods:
* `TSource? Min<TSource>(IComparer<TSource>?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.min?view=net-11.0#system-linq-enumerable-min-1(system-collections-generic-ienumerable((-0))-system-collections-generic-icomparer((-0))))
* `TSource? MinBy<TSource, TKey>(Func<TSource, TKey>, IComparer<TKey>?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.minby?view=net-11.0#system-linq-enumerable-minby-2(system-collections-generic-ienumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))))
* `TSource? MinBy<TSource, TKey>(Func<TSource, TKey>)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.minby?view=net-11.0#system-linq-enumerable-minby-2(system-collections-generic-ienumerable((-0))-system-func((-0-1))))
* `IEnumerable<TSource> Prepend<TSource>(TSource)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.prepend?view=net-11.0)
* `TSource SingleOrDefault<TSource>(Func<TSource, bool>, TSource)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.singleordefault?view=net-11.0#system-linq-enumerable-singleordefault-1(system-collections-generic-ienumerable((-0))-system-func((-0-system-boolean))-0))
* `TSource SingleOrDefault<TSource>(TSource)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.singleordefault?view=net-11.0#system-linq-enumerable-singleordefault-1(system-collections-generic-ienumerable((-0))-0))
* `IEnumerable<TSource> SkipLast<TSource>(int)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.skiplast?view=net-11.0)
Expand Down
1 change: 1 addition & 0 deletions src/Consume/Consume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,7 @@ void IEnumerable_Methods()
};
enumerable.TryGetNonEnumeratedCount(out var count);
var append = enumerable.Append("c");
var prepend = enumerable.Prepend("c");
var maxBy = enumerable.MaxBy(_ => _);
var chunk = enumerable.Chunk(3);
var minBy = enumerable.MinBy(_ => _);
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CS1591;NETSDK1138;NU1901;NU1902;NU1903;CA1822;CA1847;CA1861;NU1510;NU1608;NU1109</NoWarn>
<Version>10.4.0</Version>
<Version>10.5.0</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<PackageTags>Polyfill</PackageTags>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<ItemGroup>
<PackageVersion Include="MarkdownSnippets.MsBuild" Version="28.2.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" Pinned="true" />
<PackageVersion Include="TUnit" Version="1.37.36" />
<PackageVersion Include="ProjectDefaults" Version="1.0.173" />
<PackageVersion Include="TUnit" Version="1.43.11" />
<PackageVersion Include="ProjectDefaults" Version="1.0.174" />
<PackageVersion Include="Microsoft.Bcl.Memory" Version="10.0.7" />
<PackageVersion Include="ProjectFiles" Version="1.1.1" />
<PackageVersion Include="System.Memory" Version="4.6.3" />
Expand Down
25 changes: 25 additions & 0 deletions src/Polyfill/Polyfill_IEnumerable_Prepend.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#if NET46X || NET47

namespace Polyfills;

using System.Collections.Generic;

static partial class Polyfill
{
/// <summary>
/// Adds a value to the beginning of the sequence.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.prepend?view=net-11.0
public static IEnumerable<TSource> Prepend<TSource>(
this IEnumerable<TSource> target,
TSource element)
{
yield return element;

foreach (var item in target)
{
yield return item;
}
}
}
#endif
20 changes: 20 additions & 0 deletions src/Split/net461/Polyfill_IEnumerable_Prepend.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Collections.Generic;
static partial class Polyfill
{
/// <summary>
/// Adds a value to the beginning of the sequence.
/// </summary>
public static IEnumerable<TSource> Prepend<TSource>(
this IEnumerable<TSource> target,
TSource element)
{
yield return element;
foreach (var item in target)
{
yield return item;
}
}
}
20 changes: 20 additions & 0 deletions src/Split/net462/Polyfill_IEnumerable_Prepend.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Collections.Generic;
static partial class Polyfill
{
/// <summary>
/// Adds a value to the beginning of the sequence.
/// </summary>
public static IEnumerable<TSource> Prepend<TSource>(
this IEnumerable<TSource> target,
TSource element)
{
yield return element;
foreach (var item in target)
{
yield return item;
}
}
}
20 changes: 20 additions & 0 deletions src/Split/net47/Polyfill_IEnumerable_Prepend.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Collections.Generic;
static partial class Polyfill
{
/// <summary>
/// Adds a value to the beginning of the sequence.
/// </summary>
public static IEnumerable<TSource> Prepend<TSource>(
this IEnumerable<TSource> target,
TSource element)
{
yield return element;
foreach (var item in target)
{
yield return item;
}
}
}
8 changes: 8 additions & 0 deletions src/Tests/PolyfillTests_IEnumerable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ public async Task IEnumerableAppend()
await Assert.That(enumerable.Append("c").SequenceEqual(["a", "b", "c"])).IsTrue();
}

[Test]
public async Task IEnumerablePrepend()
{
IEnumerable<string> enumerable = ["b", "c"];

await Assert.That(enumerable.Prepend("a").SequenceEqual(["a", "b", "c"])).IsTrue();
}

[Test]
public async Task IEnumerableSkipLast()
{
Expand Down
Loading