public ListDecoder(ListType listType) { if (listType.Fields.Count != 1) { throw new ArgumentException("List type contains more than 1 field.", nameof(listType)); } _childDecoder = SchemaToDecoder.FieldsToDecoders(listType.Fields).First(); _listType = typeof(List <>).MakeGenericType(_childDecoder.GetFieldType()); }
public NullDecoder(ColumnDecoder decoder) { _decoder = decoder; _type = _decoder.GetFieldType(); if (_type.IsPrimitive || _type.IsValueType) { //If it is a primitive, add nullable _type = typeof(Nullable <>).MakeGenericType(_type); } }