I have these entities:
public class Product
{
public string Code {get;set;}
public string Name {get;set;}
public ICollection<Pack> Packs {get;set;}
}
public class Pack
{
public string Colour {get;set;}
public string Moq {get;set;}
}
my json object:
var products = [{
code: 1243123,
name: "Gel",
packs: [{
color: "blue",
moq: 10
}]
}];
note the naming differences, i.e. case and american spelling of color. Will the JavaScriptConvert.DeserializeObject() deserialise that correctly?
Or will I have to do it another way?
If I can just have an object where I can access those names directly and there values that would be great!
packsis an array but in yourProductclass it's a single item, I think this will be an issue