在 kendo ui 中将数组作为参数传递

Passing array as a parameter in kendo ui

我正在尝试将数组作为参数从 kendo ui 数据源传递。我起诉传统方式,但如果列表始终为空。任何帮助将不胜感激。

JS代码

read: {
      url: application.getWebRoot() + "api/reportbuilder",
      type: "GET",
      traditional: true,
      data: () => {
       return { dataTypes: [1, 2, 3] }
}

MVC 控制器

[HttpGet]
[Route]
public IEnumerable<ReportRowDto> Get(int[] dataTypes)
{
        //dataTypes is null
        return null;
}

我缺少 [FromUri] 属性:

[HttpGet]
[Route]
public IEnumerable<ReportRowDto> Get([FromUri]int[] dataTypes)
{
        return null;
}