Method If
If(Expression<Func<TData, bool>>, Action<IWorkflowBuilder<TData>>, Action<IWorkflowBuilder<TData>>?)
Branches on a predicate over the data document.
IWorkflowBuilder<TData> If(Expression<Func<TData, bool>> condition, Action<IWorkflowBuilder<TData>> then, Action<IWorkflowBuilder<TData>>? otherwise = null)
Parameters
conditionExpression<Func<TData, bool>>thenAction<IWorkflowBuilder<TData>>otherwiseAction<IWorkflowBuilder<TData>>
Returns
- IWorkflowBuilder<TData>
Remarks
The predicate must be pure. It is evaluated at execution time against the persisted
document, and may be re-evaluated after a rehydration, so it must depend on nothing but
TData. Taking an Expression<TDelegate> rather than a
delegate is what lets the exported shape show the condition instead of an opaque box.