我想通過int數組,但我不能在的WebAPI方法傳遞整數數組的WebAPI方法
var postData = { "deletedIds": deletedIds };
$.ajax({
type: "DELETE",
traditional: true,
dataType: 'json',
contentType: 'application/json',
cache: false,
url: "/api/Management/Models",
data: JSON.stringify(postData),
success: ModelDeleted,
error: ModelNotDeleted
});
和apiController獲得的價值:
[HttpDelete]
public bool DeleteModel(int[] deletedIds)
{
return modelsRepository.DeleteModels(deletedIds);
}
我試圖刪除JSON.stringify但仍然沒有工作 – 2013-05-04 21:34:18