Unable to deserialize my json

后端 未结 2 803

This is my class

Initial one which actually needs to be transformed to good json data. This is the initial bad one

{
    \"channels\": {
        \"he         


        
2条回答
  •  感动是毒
    2020-12-12 08:31

    Well as far as I'm familiar with json these two things the class and the json are two complete different things! So it's clear that it can't be serialize as that.

    What I do in such cases is that I deserialize the json as a dynamic object and then see the object that C# creates and compare it with my class. You can do the same thing like this:

    dynamic res = JsonConvert.Deserialize(json);
    

    You can then place a breakpoint here and see what deserializer gives you.

提交回复
热议问题