ASP.NET Core Minimal API 项目在启动时出现下面的错误:
System.InvalidOperationException: Body was inferred but the method does not allow inferred body parameters.
Below is the list of parameters that we found:
Parameter | Source
---------------------------------------------------------------------------------
BrandId | Route (Inferred)
ReleasedOnly | Query String (Inferred)
TopicIds | Body (Inferred)
TagId | Query String (Inferred)
OrderByString | Query String (Inferred)
query | As Parameter (Attribute)
Did you mean to register the "Body (Inferred)" parameter(s) as a Service or apply the [FromServices] or [FromBody] attribute?
把 TopicIds 参数类型从 List<int>
改为 int[]
解决了