Table of Contents

Method If

Namespace
Millrace.Workflows
Assembly
Millrace.dll

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

condition Expression<Func<TData, bool>>
then Action<IWorkflowBuilder<TData>>
otherwise Action<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.