commit a04646840cf27c2ada73dabf8a4d3d8e25953a49 Author: DavidOnTop Date: Mon Jun 2 20:42:35 2025 +0200 Initial commit diff --git a/FuncExt.sln b/FuncExt.sln new file mode 100644 index 0000000..80c696c --- /dev/null +++ b/FuncExt.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FuncExt", "FuncExt\FuncExt.csproj", "{59855255-B71C-4C6D-8818-53D02D17EC19}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {59855255-B71C-4C6D-8818-53D02D17EC19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59855255-B71C-4C6D-8818-53D02D17EC19}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59855255-B71C-4C6D-8818-53D02D17EC19}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59855255-B71C-4C6D-8818-53D02D17EC19}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/FuncExt/Ext.cs b/FuncExt/Ext.cs new file mode 100644 index 0000000..8f3da65 --- /dev/null +++ b/FuncExt/Ext.cs @@ -0,0 +1,14 @@ +namespace FuncExt; + +public static class Pipe { + public static TRet Run(this T obj, Func action) => + action(obj); + + public static (T, TRet) Also(this T obj, Func action) => + (obj, action(obj)); + + public static T Apply(this T obj, Action action) { + action(obj); + return obj; + } +} \ No newline at end of file diff --git a/FuncExt/FuncExt.csproj b/FuncExt/FuncExt.csproj new file mode 100644 index 0000000..d1ad21d --- /dev/null +++ b/FuncExt/FuncExt.csproj @@ -0,0 +1,10 @@ + + + + net10.0 + enable + enable + true + + +