Hi I have a class like :
public class Event : Dictionary<AttributeType, object>
AttributeType is enum
Deserializing will throw an exception
var @event = new Event { { AttributeType.EventId, Guid.NewGuid() } };
MessagePackSerializer.Deserialize<Event(MessagePackSerializer.Serialize(@event));
Exception message is:
System.ArgumentException: 'The value "21" is not of type "BRCo.Core.Common.Enums.AttributeType" and cannot be used in this generic collection.'
But when I use this code it's ok
var @event = new Event { { AttributeType.EventId, Guid.NewGuid() } };
MessagePackSerializer.Deserialize<Dictionary<AttributeType, object>>(MessagePackSerializer.Serialize(@event));
Any help?
Thanks