/// <summary> /// Applies a set of transforms to future executions. /// </summary> /// <typeparam name="TFilter">The type of the filter.</typeparam> /// <param name="source">The source.</param> /// <param name="transforms">The transforms.</param> /// <returns>INoResultCommandProcessor<TFilter, TResult>.</returns> /// <exception cref="ArgumentNullException">At least one transform is required.</exception> public static IMultipleResultSetCommandProcessor <TFilter> ApplyTransforms <TFilter>( this IMultipleResultSetCommandProcessor <TFilter> source, Func <IMultipleResultSetCommandProcessor <TFilter>, IEnumerable <CommandTransform> > transforms) { if (transforms == null) { throw new ArgumentNullException(nameof(transforms), "At least one transform is required."); } return(source.InterceptOrProxyWith(s => new MultipleResultSetTransformProxy <TFilter>(s, transforms(s)))); }
/// <summary> /// Allows providing an action which is executed against any execution exceptions. /// </summary> /// <typeparam name="TFilter">The type of the filter.</typeparam> /// <param name="source">The source.</param> /// <param name="executionInterception">The execution interception.</param> /// <returns>INoResultCommandProcessor<TFilter, TResult>.</returns> /// <exception cref="System.ArgumentNullException"></exception> public static IMultipleResultSetCommandProcessor <TFilter> InterceptExceptions <TFilter>( this IMultipleResultSetCommandProcessor <TFilter> source, Action <SusanooExecutionException> executionInterception) { if (executionInterception == null) { throw new ArgumentNullException(nameof(executionInterception)); } return (source.InterceptOrProxyWith( s => new MultipleResultSetExceptionInterceptionProxy <TFilter>(s, executionInterception))); }