Hello I have this code:
trough HttpClient I recieve this json string:
{"group":3,"data":[{"count":1,"providerName":"BetaDigital","providerNo":12},{"count":139,"providerName":"Free to air","providerNo":1}]}
var serializer = new DataContractJsonSerializer(typeof(GroupProvider));
var ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
var data = (GroupProvider) serializer.ReadObject(ms);
Then I have this classes:
[DataContract]
public class GroupProvider
{
public int Group { get; set; }
public DataGroupProvider[] data { get; set; }
}
[DataContract]
public class DataGroupProvider
{
public int Count { get; set; }
public string ProviderName { get; set; }
public int ProviderNo { get; set; }
}
Problem is, that only the Group is filled and the DataGroupProvider is null..
Where is the problem?