下面是我的代码(部分代码),我想将其迁移到asp.net核心.我的问题是"Request.CreateResponse"在下面的代码中不起作用.我谷歌很多,但无法找到任何解决方案.我该如何解决?包Microsoft.AspNet.WebApi.Core也无法正常工作.
[HttpPost] public HttpResponseMessage AddBusinessUsersToBusinessUnit(MyObject request) { return Request.CreateResponse(HttpStatusCode.Unauthorized); }
提前致谢.
最后我做了一个解决方案.:)
[HttpPost] public HttpResponseMessage AddBusinessUsersToBusinessUnit(MyObject request) { return new HttpResponseMessage(HttpStatusCode.Unauthorized); }