Skip to content

Instantly share code, notes, and snippets.

@laur3d
Created September 11, 2020 07:00
Show Gist options
  • Save laur3d/cb2e4701b0a105a165a2ddaf51febeef to your computer and use it in GitHub Desktop.
Save laur3d/cb2e4701b0a105a165a2ddaf51febeef to your computer and use it in GitHub Desktop.
public class DynamicOrchestrator
{
[FunctionName(nameof(DynamicOrchestrator))]
public async Task<string> Run([OrchestrationTrigger] IDurableOrchestrationContext context,
ExecutionContext executionContext)
{
var input = context.GetInput<OrchestratorInput>();
string greeting = "";
switch (input.Name.Length)
{
case <= 4 :
greeting = await context.CallSubOrchestratorAsync<string>(nameof(ShortNameOrchestrator), input);
break;
default:
greeting = await context.CallSubOrchestratorAsync<string>(nameof(LongNameOrchestrator), input);
break;
}
return greeting;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment