相关疑难解决方法(0)

将整数数组传递给ASP.NET Web API?

我有一个ASP.NET Web API(版本4)REST服务,我需要传递一个整数数组.

这是我的行动方法:

public IEnumerable<Category> GetCategories(int[] categoryIds){
// code to retrieve categories from database
}
Run Code Online (Sandbox Code Playgroud)

这是我尝试过的URL:

/Categories?categoryids=1,2,3,4
Run Code Online (Sandbox Code Playgroud)

c# arrays rest asp.net-web-api

397
推荐指数
12
解决办法
25万
查看次数

标签 统计

arrays ×1

asp.net-web-api ×1

c# ×1

rest ×1