public Task ExecuteAsync(string jobName, int version, string json, CancellationToken cancellationToken) { if (!_jobDefinitionService.TryGetDefinition(jobName, version, out var jobDefinition)) { throw UnknownJobException.With(jobName, version); } var executeCommandJob = (IJob)_jsonSerializer.Deserialize(json, jobDefinition.Type); return(executeCommandJob.ExecuteAsync(_serviceProvider, cancellationToken)); }