public static IOrchestrationConfiguration MapCommand <T>(this IOrchestrationConfiguration configuration, string orchestrationName, Func <ICommand, TimeSpan> orchestrationTimeout = null) where T : IProviderCommand { if (configuration is null) { throw new ArgumentNullException(nameof(configuration)); } if (string.IsNullOrEmpty(orchestrationName)) { throw new ArgumentException("Cannot be null or empty.", nameof(orchestrationName)); } if (!FunctionsEnvironment.FunctionExists(orchestrationName)) { throw new ArgumentOutOfRangeException(nameof(orchestrationName), $"Could not find orchstration by name '{orchestrationName}'"); } configuration.Orchestrations[typeof(T)] = new OrchestrationSettings() { OrchestrationName = orchestrationName, OrchstrationTimeout = orchestrationTimeout ?? OrchestrationSettings.DefaultOrchestrationTimeout }; return(configuration); }
public bool CanHandle(IOrchestratorCommand orchestratorCommand) { if (orchestratorCommand is null) { throw new ArgumentNullException(nameof(orchestratorCommand)); } var orchestrationName = GetCommandOrchestrationName(orchestratorCommand); return(FunctionsEnvironment.FunctionExists(orchestrationName)); }