Is it possible to pass in JSON array of array to my List of Lists model property and it bind properly? Or must I make my .NET model an array of array too? My Clients pass me JSON to my model in the controller and the list> property of the model is always empty.
Here is how my model looks.
[DataContract]
public class EntityModel
{
[DataMember]
public string Username { get; set; }
[DataMember]
public List<List<SocialMediaModel>> socialMedias { get; set; }
}
Here is how the "SocialMediaModel" looks
[DataContract]
public class SocialMediaModel
{
[DataMember]
public string Name { get; set;}
[DataMember]
public string URL { get; set; }
[DataMember]
public string Handle { get; set; }
[DataMember]
public bool Can_Solicit { get; set; }
}
And then here is the controller's method signature
public PostResponse Post(string token, EntityModel entity)
{
//Implementation here
}
If this is possible, how might the JSON look? I'm trying to help my clients with their JSON formatted requests. Thanks!