/// <summary> /// The Action(value).ToFunc() creates a function which when called will /// runs the action and returns unit. /// </summary> /// <param name="action">Any action with 1 param</param> /// <typeparam name="T">The type of the value.</typeparam> /// <returns>Func<T,Unit>()</returns> public static Func <T, Unit> ToFunc <T>(this Action <T> action) => ActionToFunc.ToFunc(action);
/// <summary> /// The Action(value).ToFunc() creates a function which when called will /// runs the action and returns unit. /// </summary> /// <param name="action">Any action with 2 param</param> /// <typeparam name="T1">The type of first value.</typeparam> /// <typeparam name="T2">The type of second value.</typeparam> /// <returns>Func<T1,T2,Unit>()</returns> public static Func <T1, T2, Unit> ToFunc <T1, T2>(this Action <T1, T2> action) => ActionToFunc.ToFunc(action);
/// <summary> /// The Action.ToFunc() creates a function which when called will /// runs the action and returns unit. /// </summary> /// <param name="action">Any action with no params.</param> /// <returns>Func<out Unit>()</returns> public static Func <Unit> ToFunc(this Action action) => ActionToFunc.ToFunc(action);