Dictionary<ObjKey,List<ObjItem>> cant be deserialize, error : Object must implement IConvertible.

Jan 23, 2014 at 2:25 PM
When I try to deserialize this obj:
public class ObjKey
{
    public int Id { get; set; }
    public string Name { get; set; }
}

public class ObjItem
{
    public long IdItem { get; set; }
    public string Title { get; set; }
}

public class Item
{
    public Dictionary<ObjKey, List<ObjItem>> DicValue { get; set; } 
}
and the code :

var msg = new Item()
        {
            DicValue = new Dictionary<ObjKey, List<ObjItem>>()
        };
        msg.DicValue[new ObjKey(){ Id = 1, Name = "value1" }] = new List<ObjItem>()
        {
           new ObjItem(){IdItem = 1, Title = "a1"},
           new ObjItem(){IdItem = 2, Title = "a2"},
           new ObjItem(){IdItem = 3, Title = "a3"},
        };

        var str = JSON.Instance.ToJSON(msg);
        var obj = JSON.Instance.ToObject(str); //<<<<Error with Object must implement IConvertible.
Please help me, I dont know this is a bug or not :(