.net core webapi参数绑定处理

在 Startup的ConfigureServices方法中添加:

services.Configure<ApiBehaviorOptions>(options =>
{
options.SuppressConsumesConstraintForFormFileParameters = true;
options.SuppressInferBindingSourcesForParameters = true;
options.SuppressModelStateInvalidFilter = true;
});

猜你喜欢

转载自www.cnblogs.com/zhuyuchao/p/9953006.html