public static async Task <T> RunConditionalPattern(T entry, PatternConditionalDelegate <T> patternConditionalDelegate,
                                                           PatternResultDelegate <T> patternPassedResultDelegate,
                                                           PatternDelegate <T> patternFailedDelegate)
        {
            var pattern = new ConditionalPattern <T>(patternPassedResultDelegate, patternFailedDelegate);

            return(await pattern.Run(patternConditionalDelegate, entry));
        }
        public static async Task <T> RunConditionalPattern(T entry,
                                                           PatternResultDelegate <T> patternPassedResultDelegate,
                                                           PatternDelegate <T> patternFailedDelegate, params IConditionalException <T>[] conditionalExceptions)
        {
            var pattern = new ConditionalPattern <T>(patternPassedResultDelegate, patternFailedDelegate);

            return(await pattern.Run(entry, patternConditionalDelegates : conditionalExceptions));
        }
 private ConditionalPattern(PatternResultDelegate <T> patternPassedResultDelegate,
                            PatternDelegate <T> patternFailedDelegate)
 {
     _patternPassedResultDelegate = patternPassedResultDelegate;
     _patternFailedDelegate       = patternFailedDelegate;
 }