private static void Deserialize(IReadOnlyDictionary <string, string> values, ITaskJobsConfiguration result, string prefix) { if (!string.IsNullOrEmpty(prefix) && !prefix.EndsWith(".", StringComparison.Ordinal)) { prefix = prefix + "."; } result.MaxWorkers = RedisConverter.ParseIntegerOrNull(values[prefix + "MaxTasks"]); foreach (KeyValuePair <string, string> pair in values.Where(v => v.Key.StartsWith(prefix, StringComparison.Ordinal) && v.Key.EndsWith(".TaskType", StringComparison.Ordinal))) { Type taskType = RedisConverter.ParseType(pair.Value); ITaskJobConfiguration jobConfig = result.Add(taskType); string key = string.Concat(prefix, taskType.Name, ".MaxWorkers"); jobConfig.MaxWorkers = RedisConverter.ParseIntegerOrNull(values[key]); } }