I have a Web API controller that accepts an Inspection model, i.e.
public class Inspection
{
public int ID {get; set;}
}
and I have create a POST method on the controller. This works fine and I have tested it with jQuery.
In my javascript page I create an Inspection, i.e.
var inspection = {
ID: '123456'
};
and then do $.ajax like this:
var p = $.ajax({
type: 'POST',
url: 'http://...',
cache: false,
data: JSON.stringify(item),
dataType: 'json',
success: function(response) {
//do stuff
}
});
So my question is: if I have multiple inspections to post, how do I send them all to the controller either in one batch or in single batches?