private void CheckExecutorConfigDuplicate(ParallelCommandExecutorConfig config) { var existsExecutorConfigs = _executorConfigs.Select(e => e.Name); if (existsExecutorConfigs.Contains(config.Name)) { throw new DupilicateExecutorException(); } }
public IParallelCommandExecutorContainer RegisterExecutor <TExecutor>() where TExecutor : class, IParallelCommandExecutor { var executor = _httpContextAccessor.HttpContext.RequestServices.GetService <TExecutor>(); var executorConfig = new ParallelCommandExecutorConfig(executor); CheckExecutorConfigDuplicate(executorConfig); _executorConfigs.Add(executorConfig); return(this); }