/// <summary> /// Adds an adapter for the step to the transaction. /// </summary> /// <typeparam name="TStepIdTo">The type of the destination step id.</typeparam> /// <typeparam name="TDataTo">The type of the destination data.</typeparam> /// <typeparam name="TStepIdFrom">The type of the original step id.</typeparam> /// <typeparam name="TDataFrom">The type of the source data.</typeparam> /// <param name="step">The original step.</param> /// <param name="stepConverter">The step converter.</param> /// <param name="reverseStepConverter">The reversed step converter.</param> /// <param name="dataConverter">The data converter.</param> /// <returns>The transaction.</returns> public static ITransaction <TStepIdTo, TDataTo> AddAdapter <TStepIdTo, TDataTo, TStepIdFrom, TDataFrom>( this ITransaction <TStepIdTo, TDataTo> transaction, ITransactionStep <TStepIdFrom, TDataFrom> step, Func <TStepIdFrom, TStepIdTo> stepConverter, Func <TStepIdTo, TStepIdFrom> reverseStepConverter, Func <TDataTo, TDataFrom> dataConverter) { return(transaction.Add(step.Adapter(stepConverter, reverseStepConverter, dataConverter))); }
/// <summary> /// Inserts a step adapter at an index. /// </summary> /// <typeparam name="TStepIdTo">The type of the destination step id.</typeparam> /// <typeparam name="TDataTo">The type of the destination data.</typeparam> /// <typeparam name="TStepIdFrom">The type of the original step id.</typeparam> /// <typeparam name="TDataFrom">The type of the source data.</typeparam> /// <param name="index">The index.</param> /// <param name="step">The step.</param> /// <param name="stepConverter">The step converter.</param> /// <param name="reverseStepConverter">The reversed step converter.</param> /// <param name="dataConverter">The data converter.</param> /// <returns>The transaction.</returns> public static ITransaction <TStepIdTo, TDataTo> InsertAdapterAtIndex <TStepIdTo, TDataTo, TStepIdFrom, TDataFrom>( this ITransaction <TStepIdTo, TDataTo> transaction, int index, ITransactionStep <TStepIdFrom, TDataFrom> step, Func <TStepIdFrom, TStepIdTo> stepConverter, Func <TStepIdTo, TStepIdFrom> reverseStepConverter, Func <TDataTo, TDataFrom> dataConverter) { return(transaction.InsertAtIndex(index, step.Adapter(stepConverter, reverseStepConverter, dataConverter))); }
/// <summary> /// Inserts a step adapter after a specific step id. /// </summary> /// <typeparam name="TStepIdTo">The type of the destination step id.</typeparam> /// <typeparam name="TDataTo">The type of the destination data.</typeparam> /// <typeparam name="TStepIdFrom">The type of the original step id.</typeparam> /// <typeparam name="TDataFrom">The type of the source data.</typeparam> /// <param name="id">The step id.</param> /// <param name="step">The step.</param> /// <param name="stepConverter">The step converter.</param> /// <param name="reverseStepConverter">The reversed step converter.</param> /// <param name="dataConverter">The data converter.</param> /// <param name="idComparer">The step id comparer.</param> /// <returns>The transaction.</returns> public static ITransaction <TStepIdTo, TDataTo> InsertAdapterAfter <TStepIdTo, TDataTo, TStepIdFrom, TDataFrom>( this ITransaction <TStepIdTo, TDataTo> transaction, TStepIdTo id, ITransactionStep <TStepIdFrom, TDataFrom> step, Func <TStepIdFrom, TStepIdTo> stepConverter, Func <TStepIdTo, TStepIdFrom> reverseStepConverter, Func <TDataTo, TDataFrom> dataConverter, IEqualityComparer <TStepIdTo> idComparer = null) { return(transaction.InsertAfter(id, step.Adapter(stepConverter, reverseStepConverter, dataConverter), idComparer)); }