【问题标题】:"Not Found" Exception when trying to call UpdateAsync or InsertAsync尝试调用 UpdateAsync 或 InsertAsync 时出现“未找到”异常
【发布时间】:2017-01-17 19:59:14
【问题描述】:

我正在基于 TodoItem 示例创建一个非常基本的 Azure 移动应用程序,但遇到了一个奇怪的问题。我可以毫无问题地连接到表控制器并调用 ToEnumerableAsync (GET),但只要我调用 UpdateAsync 或 InsertAsync,就会得到 404(未找到)响应。我尝试重新创建表控制器,禁用身份验证等无济于事。

Azure 上的日志流看到 PATCH 消息并返回 404。不是很有帮助...

我的 DTO 如下所示:

public class Patient : EntityData
{
    public string PersonalHealthNumber{ get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public DateTime? DateOfBirth { get; set; }
}

我的客户端病人看起来像这样:

public class Patient
{
    public string Id { get; set; }
    public string PersonalHeathNumber { get; set; }
    public string FirstName { get; set; }
    public string MiddleName { get; set; }
    public string LastName { get; set; }
    public DateTime? DateOfBirth { get; set; }
    [Version]
    public string Version { get; set; }
}

【问题讨论】:

  • 你的控制器是什么样子的?

标签: xamarin azure-mobile-services


【解决方案1】:

尝试从 TableData 基类派生您的客户端模型,并从您的客户端模型中删除 2 个属性 IdVersion,因为它们在基类中

【讨论】:

    猜你喜欢
    • 2012-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-03
    • 2013-11-16
    • 1970-01-01
    • 2018-08-08
    相关资源
    最近更新 更多