I have read this link: How to develop an ASP.NET Web API to accept a complex object as parameter?
And implemented the code just fine. Now I want to convert the 'firstName' parameter to accept an IList<string> collection. I have modified the class like this:
public class MyApiParameters
{
public IList<string> FirstName { get; set; }
public string LastName { get; set; }
public DateTime BirthDate { get; set; }
}
I was hoping that the accepted URL would look like this:
http://localhost:58256/api/articles?firstName=matthew,andrew,philip,david&LastName=smith&birthDate=12-12-2012
But the parameter is only interpreted as a list if I pass it like this:
http://localhost:58256/api/articles?firstName=matthew&firstName=andrew&firstName=philip&firstName=david&LastName=smith&birthDate=12-12-2012