这里出了什么问题: return CreatedAtAction(nameof(TrustedPerson), new { id = item.Id }, TrustedPerson(item)); 模型_db.TrustedPeople.Add(item); return CreatedAtAction(nameof(TrustedPerson), new { id = item.Id }, TrustedPerson(item));
我们有一个Azure服务,托管我们不同的功能API。我现在遇到的问题是当我发送一个POST请求时,它用响应体返回500。 <li>IIS was not able to access the web.config file for the Web site orfile are correct and allow access to the W
我使用以下代码Post一个新的Waste实体:Api Controller(使用VS创建的代码)似乎试图通过以下方法返回Waste实体的新Id,从而简化了我的工作:
return CreatedAtAction("GetWaste", new { id = waste.Id当然,ASP.Net核心的创建者们会对此提出一个巧妙的呼
我刚开始测试.net核心web,并且很难在我的API上测试POST方法。我可以断言返回的ActionResult的类型,但我似乎不知道如何将结果与我正在创建的夹具进行比较。我已经调试了单元测试,并看到CreatedAtAction调用正在返回一个ActionResult。顶层值为null。但是,结果的值有项。下面是来自我的控制器的(POST)方法: public async Task<Acti