public static IConnectorLinker <T> Conditional <T>(this IConnectorLinker <T> parent, Predicate <T> predicate, Action <IConnectorLinker <T> > buildChain) { var connector = new ConditionalSubChainConnector <T>(predicate, buildChain, parent.Context); parent.Link(connector); return(connector); }
internal static IConnectorLinker <T> TestDelay <T>( this IConnectorLinker <T> parent, int millisecondsDelay) { var next = new DelayConnector <T>(millisecondsDelay, parent.Context); return(parent.Link(next)); }
public static IConnectorLinker <TOutput> Map <T, TOutput>(this IConnectorLinker <T> parent, MapperDelegate <T, TOutput> mapper) { var connector = new MappingConnector <T, TOutput>(mapper, parent.Context); parent.Link(connector); return(connector); }
public override void ConfigureRootConnector(IConnectorLinker <Signal> root) { root.Link <GetLoanInquiry, LoanInquiry>() .Link <CreateLoanApplication, LoanApplication>() .Conditional(CreditScoreIsBad, builder => builder .Link <DenyLoan, Signal>() .Complete("Denied") ) .Link <CreateLoanContract, LoanContract>() .Link <ApproveLoan, Signal>(); }
public override void ConfigureRootConnector(IConnectorLinker <Signal> root) { root.Link <GetLoanInquiry, LoanInquiry>() .Link <CreateLoanApplication, LoanApplication>() .If(application => !CreditScoreIsValid(application), then => then .Link <DenyLoan, Signal>() ) .If(CreditScoreIsValid, then => then .Link <CreateLoanContract, LoanContract>() .Link <ApproveLoan, Signal>() ); }
internal static IConnectorLinker <T> TestInspect <T>( this IConnectorLinker <T> parent, InitAction?onInit = null, ProcessAction <T>?onProcess = null, DisposeAction?onDispose = null) { var next = new TestInspectConnector <T>(onInit, parent.Context) { ProcessAction = onProcess, DisposeAction = onDispose }; return(parent.Link(next)); }
public override void ConfigureRootConnector(IConnectorLinker <string> root) { root.SubChain(subChain => subChain .Link <GenerateArray, int[]>("GenerateArray") .Each(each => each .If(IsDivisibleBy3, then => then .Map(_ => "Fizz") .Link <LogInformation <string>, string>() ) .If(IsDivisibleBy5, then => then .Map(_ => "Buzz") .Link <LogInformation <string>, string>() ) .If(i => !IsDivisibleBy3(i) && !IsDivisibleBy5(i), then => then .Link <LogInformation <int>, int>() ))) .Link <StringToDateTime, DateTime>() .Link <LogDateTime, DateTime>(); }
public override void ConfigureRootConnector(IConnectorLinker <string> root) { root.Conditional(string.IsNullOrEmpty, _ => _ .Complete("Payload is empty")) .SubChain(subChain => subChain .Link <GenerateArray, int[]>("GenerateArray") .Each(each => each .Conditional(IsDivisibleBy3, then => then .Map(_ => "Fizz") .Link <LogInformation <string>, string>() ) .Conditional(IsDivisibleBy5, then => then .Map(_ => "Buzz") .Link <LogInformation <string>, string>() ) .Conditional(i => !IsDivisibleBy3(i) && !IsDivisibleBy5(i), then => then .Link <LogInformation <int>, int>() ))) .Link <StringToDateTime, DateTime>() .Link <LogDateTime, DateTime>(); }
public static IConnectorLinker <IReadOnlyList <T> > Each <T>(this IConnectorLinker <IReadOnlyList <T> > parent, Action <IConnectorLinker <T> > buildChain) { var connector = new EnumerationConnector <T>(buildChain, parent.Context); return(parent.Link(connector)); }
public static void Complete <T>(this IConnectorLinker <T> parent, string reason) { var connector = new CompletionConnector <T>(reason, parent.Context); parent.Link(connector); }
public static IConnectorLinker <T> SubChain <T>(this IConnectorLinker <T> parent, Action <IConnectorLinker <T> > buildChain) { var connector = new SubChainConnector <T>(buildChain, parent.Context); return(parent.Link(connector)); }
public override void ConfigureRootConnector(IConnectorLinker <Order> root) { root.Link <PrintOrderToConsole, Order>(); }
public override void ConfigureRootConnector(IConnectorLinker <T> root) { ConfigureRootAction?.Invoke(root); }
public abstract void ConfigureRootConnector(IConnectorLinker <T> root);
public override void ConfigureRootConnector(IConnectorLinker <HttpTestPayload> root) { root.Map(x => x); }