Closed johnkievlan closed 5 years ago
Yeah, that might be cool.
Meanwhile this extension method could be of use.
public static EventActivityBinder<TInstance, TData> IfThenElse<TInstance, TData>(
this EventActivityBinder<TInstance, TData> binder,
StateMachineCondition<TInstance, TData> condition,
Func<EventActivityBinder<TInstance, TData>, EventActivityBinder<TInstance, TData>> thenActivityCallback,
Func<EventActivityBinder<TInstance, TData>, EventActivityBinder<TInstance, TData>> elseActivityCallback)
where TInstance : class
{
var result = false;
return binder.If(context => result = condition(context), thenActivityCallback).If(_ => !result, elseActivityCallback);
}
Fixed by #55
You know what would be nice? IfElse :)