public static OutputPipe <TEntity> InvalidWhen <TEntity>( this IOutputPipe <TEntity> pipe, Func <TEntity, bool> invalidCheck, int statusCode, object error = null) where TEntity : class => pipe.InvalidWhen(e => Task.FromResult(invalidCheck(e)), statusCode, error);
public static OutputPipe <TInput> InvalidWhen <TInput>( this IOutputPipe <TInput> pipe, Func <bool> invalidCheck, int statusCode, object error = null) where TInput : class => pipe.InvalidWhen(() => Task.FromResult(invalidCheck()), statusCode, error);