I have a question for deserialize/serialize with the Newtonsoft JSON.NET library:
I receive this json :
{
\"customerName\" : \"Lorem\",
\"id
You need to make custom type for "attribute" like:
public class Attribute {
[JsonProperty(PropertyName = "nbrOfUse")]
public int _nbrOfUse { get; set; }
[JsonProperty(PropertyName = "streetType")]
[Display(Name = "lastUse", ResourceType = typeof(AccountModels))]
public string _lastUse { get; set; }
}
And make an Object of Attribute class in your Address class.
One possible solution you could use, which might look a bit hacky, would be to manipulate the JSON string before parsing it, using a regex for example.
You would identify and replace
"attribute" : {
"nbrOfUse" : 1,
"lastUse" : "2013-01-03T09:57:28-0500"
}
with
"lastUse" : "2013-01-03T09:57:28-0500"
Then, your serializer would identify a DateTime? property named "lastUsed"