example.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var whileRow = new Sequence() | |
| { | |
| Activities = [ | |
| new Inline((context) => | |
| { | |
| var enumerator = context.Get<IAsyncEnumerator<string>>(csvEnumerator)!; | |
| var currentCsvRow = enumerator.Current; | |
| Console.WriteLine(currentCsvRow); | |
| }), | |
| new Inline(async (context) => { | |
| var commitStateHandler = context.GetRequiredService<ICommitStateHandler>(); | |
| var workflowStateExtractor = context.GetRequiredService<IWorkflowStateExtractor>(); | |
| var workflowState = workflowStateExtractor.Extract(context.WorkflowExecutionContext); | |
| await commitStateHandler.CommitAsync(context.WorkflowExecutionContext, workflowState); | |
| }) | |
| ] | |
| }; | |
| var whileActivity = new While(async (context) => | |
| { | |
| var enumerator = context.Get<IAsyncEnumerator<string>>(csvEnumerator)!; | |
| return await enumerator.MoveNextAsync(); | |
| }) | |
| { | |
| Body = whileRow | |
| }; |