How to pass DataTable
as Parameter to Controller. The data
is always null when i use the below code.
Object
public class Notification
{
public int UserId { get; set; }
public DataTable Profiles { get; set; }
}
Controller
[HttpPost]
public HttpResponseMessage UpdateNotification(Notification data)
{
if(data == null)
{
//data is always null here
}
}
Request through POSTMAN
Content-Type: application/json
{
UserId: 1,
Profiles: [1,2]
}
When i remove Profiles
, it is working fine. But on having the parameter the data
is always null. Whats an issue with it?