public JsWorkerDocumentation GetJsWorker(string workerName, JsExecutionContext executionContext) { if (!JsWorkers.ContainsKey(workerName)) { var mes = string.Format(ExceptionTexts.NoWorkerWithNameRegisteredFormat, workerName); executionContext.ExecutionLogs.Add(new JsExecutionLog { EventIdName = EventIds.JsExecutorComponents.GetJsWorkerNotFound, Message = mes, }); throw new InvalidOperationException(mes); } executionContext.ExecutionLogs.Add(new JsExecutionLog { EventIdName = EventIds.JsExecutorComponents.GetJsWorkerFound, Message = $"Js рабочий найден по указанному названию '{workerName}'", }); return JsWorkers[workerName]; }
public List <IJsWorker> EnumerateWorkers() => JsWorkers.Select(x => x(AmbientContext)).ToList();