public object Convert(string optionValue, string optionName, Type targetType, ErrorDetailList errors) { FromStringDelegate converter = _items.ContainsKey(targetType) ? _items[targetType] : _items[targetType.BaseType]; return(converter(optionValue, optionName, targetType, errors)); }
public void Register(Type targetType, FromStringDelegate convertFunc) => _items[targetType] = convertFunc;