Functional Extensions for C#

Map

public static TResult Map<TSource, TResult>(
	this TSource @this,
	Func<TSource, TResult> fn) => fn(@this);
);

Tee

public static TResult Tee<t>(
	this T @this,
	Action<T> fn) => fn(@this)
    {
		act(@this);
		return @this;
	}
);

Partial Function Application

public static Func<int, int> Add(int x) => y => x + y;
new[] {1, 2, 3}.Select(Add(1))

More stuff like this in Dave Fancher PluralSight course Functional Programming with C#

Short Summary of Delegation in C#

Classic

public delegate decimal MathOp(decimal left, decimal right)

public static decimal Add(decimal left, decimal right)
{
	return left + right;
}
private static MathOp GetOp(char op)
{
	switch (op)
	{
		case '+': return Add;
	}
}

Interfaces

public interface IMathOp
{
	decimal Compute(decimal left, decimal right);
}

public class AddOp : IMathOp
{

	decimal Compute(decimal l, decimal r)
	{
		return l + r;
	}
}

private static MathOp GetOp(char op)
{
	switch (op)
	{
		case '+': return new AddOp();
	}
}

Anonymous Methods

public delegate decimal MathOp(decimal left, decimal right)

private static MathOp GetOp(char op)
{
	switch (op)
	{
		case '+': return delegate (decimal l, decimal r) { return l + r};
	}
}

Generic Delegates and Lambda Expressions

public static Func<decimal, decimal, decimal> GetOp(char op)
{
	switch (op)
	{
		case '+': return (l, r) => l + r;
	}
}

For complete details, see Dave Fancher PluralSight course Functional Programming with C#