2

在以下 Azure 表对象上调用 save:

public class MyEntity : TableServiceEntity
{
    public string Title { get; set; }

    public string Description { get; set; }

    public float Amount { get; set; }

    public DateTime CreatedAt { get; set; }

    public DateTime UpdatedAt { get; set; }
}

引发消息异常:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <code>NotImplemented</code>
    <message xml:lang="en-US">
        The requested operation is not implemented on the specified resource.
        RequestId:8d4b648f-64c7-4584-8152-9563c6eb0733
        Time:2013-06-25T13:23:22.1722407Z
    </message>
</error>
4

1 回答 1

3

问题是 Azure 存储表没有实现浮点存储。将类型更改amount为双精度将解决问题。

public class MyEntity : TableServiceEntity
{
    public string Title { get; set; }

    public string Description { get; set; }

    public double Amount { get; set; } // <-- Note change here!!!

    public DateTime CreatedAt { get; set; }

    public DateTime UpdatedAt { get; set; }
}
于 2013-06-25T13:40:06.563 回答