c# - 如何为将字符串数组作为参数的 .Net Core 3.1 webapi 服务调用定义路由?
问题描述
我正在创建一个 .NetCore 3.1 Web API 服务。
我很难确定服务调用的正确路由定义。
考虑以下定义:
[HttpPut]
[Route("{paramA}/{paramB}")]
public void Sample(string paramA, string[] paramB)
{
}
传递字符串数组时定义路由参数的正确方法是什么?我应该改用 List 吗?