I被要求更新API并从以下代码实现
RemoveToDoItem
:
[HttpDelete("{id}", Name = "DeleteTodoItem")]
public async Task<IActionResult> RemoveTodoItem(int id)
{
// TODO
// Use EF Core to remove the item based on id
throw new NotImplementedException();
}
这是我尝试运行程序
时获得的错误代码HttpRequestException:您必须首先实现API端点。 候选人。
}
catch (Exception ex)
{
throw new HttpRequestException("You must first implement the API endpoint.");
}
throw new HttpRequestException("You must first implement the API endpoint.");
完全不确定如何解决这个问题。我尝试使用DeleteTodoItem
变量,但没有运气。
DbContext
属性上的Remove()
DbSet<T>
坚持数据库的更改。
DbContext