コード例 #1
0
        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);
        }
コード例 #2
0
        public static IOrchestrationConfiguration IgnoreCommand <T>(this IOrchestrationConfiguration configuration)
            where T : IProviderCommand
        {
            if (configuration is null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            configuration.Ignored.Add(typeof(T));

            return(configuration);
        }
コード例 #3
0
 public ProviderCommandDispatchActivity(IOrchestrationConfiguration configuration)
 {
     this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
 }
コード例 #4
0
 public CommandHandler(IOrchestrationConfiguration configuration, IHttpContextAccessor httpContextAccessor)
 {
     this.configuration       = configuration ?? throw new ArgumentNullException(nameof(configuration));
     this.httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
 }