【问题标题】:Azure Mobile Services Patch and Delete Returning 404 Not FoundAzure 移动服务补丁和删除返回 404 Not Found
【发布时间】:2015-12-04 00:25:53
【问题描述】:

我有一个连接到现有数据库的 Azure 移动服务。在测试它时,GET、GET (id) 和 POST 工作正常,但 PATCH 和 DELETE 返回错误 404 Not Found,并显示以下内容

"message":"没有找到与请求 URI 匹配的 HTTP 资源"

我看到断点被正确命中,我认为问题不在于路由。

我使用 CustomMappedEntityDomainManager,其中我有以下用于 PATCH 和 DELETE 的代码

    public async Task<RegisteredUsersDto> PatchRegisteredUsers(string id, Delta<RegisteredUsersDto> patch)
    {
         return await UpdateAsync(id, patch);
    }

    public Task DeleteRegisteredUsers(string id)
    {
         return DeleteAsync(id);
    }

任何快速指针将不胜感激。

【问题讨论】:

    标签: .net entity-framework azure asp.net-web-api azure-mobile-services


    【解决方案1】:

    仅凭此信息很难说,但听起来您的映射域管理器没有设置正确的路由。这是一个显示映射域管理器的工作示例:https://github.com/paulbatum/FieldEngineerLite/blob/master/FieldEngineerLite.Service/Controllers/JobController.cs

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-09
      • 1970-01-01
      • 2021-09-03
      • 1970-01-01
      • 1970-01-01
      • 2016-03-16
      • 2012-09-20
      相关资源
      最近更新 更多