I am trying to use automatic deserialization in my MVC action, for example:
public void CreateEntitlementEntity(EntitlementEntityModel model) {
}
And here is the class I want to deserialize:
public class EntitlementEntityModel {
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public List<string> Domains { get; set; }
public EntitlementEntityModel() { }
}
I pass the JSON data object to the controller action:
data: {
FirstName: 'first',
LastName: 'last',
Email: 'email@email.com',
Domains: ['a','b','c']
}
All properties are deserialized correctly, except for the list of strings. I would like to turn a JSON array into a list, but instead it gives me a list with one line in it, a JSON array string.
Is there a way to accomplish this in the .NET Framework 3.5?
thank
Tbabs source
share