I have a code base that uses IConvertible as a way for a class to use keys of various types (ints, enums, etc) for collections. I noticed through trial and error, and from the docs that IConvertible is not supported. Is it possible in some way to enable this capability with MemoryPack? (Example code below)
[MemoryPackable]
public partial class ItemStore : Base
{
public int MaxSpace { get; private set; }
public int UsedSpace { get; private set; }
public ImmutableHashSet<IConvertible> ItemsAllowed { get; private set; }
[MemoryPackInclude]
private int _reservedSpace;
[MemoryPackInclude]
private Dictionary<IConvertible, int> _storedItems;
[MemoryPackInclude]
private Dictionary<IConvertible, int> _reservedItems;
[MemoryPackInclude]
private ImmutableHashSet<IConvertible> _itemsAllowed;
[MemoryPackInclude]
private readonly Dictionary<IConvertible, int> _initialItemsRaw;
...
I have a code base that uses
IConvertible
as a way for a class to use keys of various types (ints, enums, etc) for collections. I noticed through trial and error, and from the docs thatIConvertible
is not supported. Is it possible in some way to enable this capability with MemoryPack? (Example code below)