/// <summary> /// Begins configuring a token with the specified identifier, and adds a processing step to it. The token is chosen based on the parameter name of the supplied method. /// </summary> /// <typeparam name = "TIn">The type of the input value.</typeparam> /// <typeparam name = "TOut">The type of the output value.</typeparam> /// <param name = "config">The config.</param> /// <param name = "transform">The transformation. The token is chosen based on the input parameter name of this method.</param> /// <returns></returns> public static IForClause <TOut> For <TIn, TOut> (this IForClauseOrigin config, Func <TIn, TOut> transform) { var name = transform.Method.GetParameters().First().Name; return(config.For <TIn>(name).Do(transform)); }
/// <summary> /// Begins configuring a single token that has many inputs. /// </summary> /// <param name="config">The config.</param> /// <param name="identifier">The identifiero f hte token.</param> /// <returns></returns> public static IForClause <IMultiInput> ForMany (this IForClauseOrigin config, string identifier) { return(config.For <IMultiInput>(identifier)); }
/// <summary> /// Begins configuring the specified token, and attaches a processing step to it. The token is chosen based on the parameter name of the supplied method. /// </summary> /// <typeparam name = "TOut">The type of the out.</typeparam> /// <param name = "config">The config.</param> /// <param name = "transform">The transformation.</param> /// <returns></returns> public static IForClause <TOut> For <TOut>(this IForClauseOrigin config, Func <dynamic, TOut> transform) { return(config.For <dynamic, TOut>(transform)); }
/// <summary> /// Begins configuring a dynamically typed token with the specified identifier. /// </summary> /// <param name="config">The config.</param> /// <param name="identifier">The identifier.</param> /// <returns></returns> public static IForClause <dynamic> For(this IForClauseOrigin config, string identifier) { return(config.For <dynamic>(identifier)); }