this is not a dup of JSON.NET: Deserializing part of a JSON object to a dictionary
I have JSON { "Count" : 2, "Head" : { "itemId":..., "quality":... }, "Legs" : { "itemId":..., "quality":... } }
I need to deserialize it into a dictionary: IDictionary<GearSlot, Item>
If I try to deserialize whole JSON I get an error because it fails to deserialize "Count:2" into <GearSlot, Item>.
GearSlot is an enum, and has ~17+ values. At this time I have defined class:
public class Items {
property Item Head { get; set; }
property Item Legs { get; set; }
...
}
it works, but not elegant and clunky.
Any suggestions?