【发布时间】:2020-07-14 22:53:28
【问题描述】:
public async Task<IActionResult> PostQueuePrimaryInsured([FromRoute]string policyNumber, [FromBody]Queue<FormRequest> body) {
HttpStatusCode result = _service.DoSomething(result);
return result;
}
如何让它返回 HttpStatusCode 结果?我无法弄清楚正确的语法。我可以让它返回 Ok()、NotFound() 等,但我不想检查每个状态代码的大 if-else 块。
【问题讨论】:
标签: c# rest asp.net-core-webapi