I have a class like below for posting to asp.net web api
public class PostData
{
public int ID { get; set; }
public int[] SelectedChoiceIDs { get; set; }
}
In my ApiController there is a method called send which gets PostData
object as parameter.
public bool Send(PostData data)
{
}
The problem is whenever I trace the method Web API is not binding to the array of integers ,that is, SelectedChoiceIDs
property. How can i force to bind the array of integers to "SelectedChoiceIDs
" property?
The data i'm sending is like
{ "ID" : 3 , "SelectedChoiceIDs" : [ 3,4,5,6 ] }