/// <summary> /// Initializes a new instance of the <see cref="NoResultSetTransformProxy{TFilter}"/> class. /// </summary> /// <param name="source">The source.</param> /// <param name="transforms">The transforms.</param> public NoResultSetTransformProxy(INoResultCommandProcessor <TFilter> source, IEnumerable <CommandTransform> transforms, Action <IExecutableCommandInfo> queryInspector = null) : base(source) { _transforms = transforms; _queryInspector = queryInspector ?? new Action <IExecutableCommandInfo>((info) => { }); }
/// <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 INoResultCommandProcessor <TFilter> ApplyTransforms <TFilter>( this INoResultCommandProcessor <TFilter> source, Func <INoResultCommandProcessor <TFilter>, IEnumerable <CommandTransform> > transforms) { if (transforms == null) { throw new ArgumentNullException(nameof(transforms), "At least one transform is required."); } return(source.InterceptOrProxyWith(s => new NoResultSetTransformProxy <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 INoResultCommandProcessor <TFilter> InterceptExceptions <TFilter>( this INoResultCommandProcessor <TFilter> source, Action <SusanooExecutionException> executionInterception) { if (executionInterception == null) { throw new ArgumentNullException(nameof(executionInterception)); } return (source.InterceptOrProxyWith( s => new NoResultSetExceptionInterceptionProxy <TFilter>(s, executionInterception))); }
/// <summary> /// Initializes a new instance of the <see cref="NoResultSetTransformProxy{TFilter}"/> class. /// </summary> /// <param name="source">The source.</param> /// <param name="transforms">The transforms.</param> public NoResultSetTransformProxy(INoResultCommandProcessor <TFilter> source, IEnumerable <CommandTransform> transforms) : base(source) { _transforms = transforms; }
/// <summary> /// Initializes a new instance of the <see cref="NoResultSetProxy{TFilter}"/> class. /// </summary> /// <param name="source">The source.</param> protected NoResultSetProxy(INoResultCommandProcessor <TFilter> source) { Source = source; }
/// <summary> /// Initializes a new instance of the <see cref="NoResultSetExceptionInterceptionProxy{TFilter}" /> class. /// </summary> /// <param name="source">The source.</param> /// <param name="exceptionInterception">The exception interception.</param> public NoResultSetExceptionInterceptionProxy(INoResultCommandProcessor <TFilter> source, Action <SusanooExecutionException> exceptionInterception) : base(source) { _exceptionInterception = exceptionInterception; }