Created
September 11, 2020 07:00
-
-
Save laur3d/cb2e4701b0a105a165a2ddaf51febeef to your computer and use it in GitHub Desktop.
This file contains 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
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