i have following json
"{\"message\":\"the content deleting associated other mashups.\",\"mashuplist\":{\"70592\":\"low frame rated test\",\"70851\":\"low frame rated test\"}}"
i unable deserilize mashuplist part of json. 70592 , 70851 not fixed attibutes can changed have done far
[datacontract] public class custombaseaffectedmashupsresponse { [datamember(name = "mashuplist")] public mashuplist mashupslist { get; set; } [datamember(name = "message")] public string message { get; set; } } [datacontract] public class mashuplist { [datamember] public list<string> mashuptitle { get; set; } }
and deserialize method
public static t deserialise<t>(string json ) { t obj = default(t); try { obj = jsonconvert.deserializeobject<t>(json, new jsonserializersettings { nullvaluehandling = nullvaluehandling.ignore }); return obj; } catch (exception exception) { return obj; } }
it not giving error dont know why not deserilize mashuplist part
i don't have enough reputation comment adding comment here not show error not deserialize
"mashuplist\":{\"70592\":\"low frame rated test\",\"70851\":\"low frame rated test\"}
the mashuplist
property's type should dictionary<string, string>
.
you don't need mashuplist
class.
the keys numbers - 70592
, 70592
. values strings, e.g. low frame rated test
.
class custombaseaffectedmashupsresponse { public dictionary<string, string> mashuplist { get; set; } public string message { get; set; } }