Add linq extension Do

This commit is contained in:
Alexandru Macocian
2021-04-03 14:44:17 +02:00
parent ee341af2c3
commit 5d442580c3
2 changed files with 10 additions and 1 deletions
@@ -58,5 +58,14 @@ namespace System.Extensions
return -1;
}
public static IEnumerable<T> Do<T>(this IEnumerable<T> enumerable, Action<T> action)
{
foreach(var value in enumerable)
{
action(value);
yield return value;
}
}
}
}
@@ -6,7 +6,7 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RootNamespace>System</RootNamespace>
<Version>1.1.2</Version>
<Version>1.1.3</Version>
<Authors>Alexandru Macocian</Authors>
<RepositoryUrl>https://github.com/AlexMacocian/SystemExtensions</RepositoryUrl>
</PropertyGroup>