Привет, у меня есть класс, как:
public class Event : Dictionary<AttributeType, object>
Тип атрибута enum
Десериализация вызовет исключение
var @event = new Event { { AttributeType.EventId, Guid.NewGuid() } };
MessagePackSerializer.Deserialize<Event(MessagePackSerializer.Serialize(@event));
Сообщение об исключении:
System.ArgumentException: 'The value "21" is not of type "BRCo.Core.Common.Enums.AttributeType" and cannot be used in this generic collection.'
Но когда я использую этот код, все в порядке
var @event = new Event { { AttributeType.EventId, Guid.NewGuid() } };
MessagePackSerializer.Deserialize<Dictionary<AttributeType, object>>(MessagePackSerializer.Serialize(@event));
Любая помощь?
Спасибо