Ejemplo n.º 1
0
 /// <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&lt;T,Unit&gt;()</returns>
 public static Func <T, Unit> ToFunc <T>(this Action <T> action)
 => ActionToFunc.ToFunc(action);
Ejemplo n.º 2
0
 /// <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&lt;T1,T2,Unit&gt;()</returns>
 public static Func <T1, T2, Unit> ToFunc <T1, T2>(this Action <T1, T2> action)
 => ActionToFunc.ToFunc(action);
Ejemplo n.º 3
0
 /// <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&lt;out Unit&gt;()</returns>
 public static Func <Unit> ToFunc(this Action action)
 => ActionToFunc.ToFunc(action);