自定义JsonConverter用于嵌套字典<,> Json.Net

时间:2014-12-10 18:25:57

标签: serialization json.net deserialization

我的Json反序列化字典存在问题。 我有以下数据结构:

public class GameObject
 {
  public GameObject()
  {
     Components = new Dictionary<UInt64, List<EntityComponent>>();
  }

  public Entity EntityTree { get; set; }

  public Dictionary<UInt64, List<EntityComponent>> Components { get; set; }
}

我用String作为Key尝试了它,但它返回异常,它说它不能转换字典的值(它的疯狂)。 有人可以帮我为这个可以正确反序列化我的字典的结构编写正确的读/写器吗? 我无法理解如何正确地做到这一点。

拜托,帮助我!

0 个答案:

没有答案
相关问题