Skip to content

Instantly share code, notes, and snippets.

@CoditCompany
Created August 24, 2017 07:50
Show Gist options
  • Select an option

  • Save CoditCompany/103d1872284da39bda997944276ec7cf to your computer and use it in GitHub Desktop.

Select an option

Save CoditCompany/103d1872284da39bda997944276ec7cf to your computer and use it in GitHub Desktop.
PipeTo extension
/// <summary>
/// Extensions to support Functional Concepts
/// </summary>
public static class FunctionalConcepts
{
/// <summary>
/// Pipes a given <paramref name="value"/> to given function <paramref name="f"/>.
/// </summary>
/// <typeparam name="TA">The type of a.</typeparam>
/// <typeparam name="TB">The type of the b.</typeparam>
/// <param name="value">The value.</param>
/// <param name="f">The function.</param>
/// <returns></returns>
public static TB PipeTo<TA, TB>(this TA value, Func<TA, TB> f)
{
return f(value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment