private TDictionary ConvertFrom(TomlTable table, ITomlSerializerContext context) { var dictionary = (TDictionary)Activator.CreateInstance(_instanceType) !; foreach (var key in table.Keys) { var value = table.TryGetValue(key, out var dictionaryValue) ? _valueConverter.ConvertFrom(dictionaryValue, context) : throw new InvalidOperationException("This should never happen"); dictionary[key] = value; } return(dictionary); }
? (TCollection)_createCollection(tomlArray.Select(v => _itemConverter.ConvertFrom(v, context))) : throw new TomlException();
public TNewType ConvertFrom(TomlObject value, ITomlSerializerContext context) => _constructor(_innerConverter.ConvertFrom(value, context));