1

注文エンティティを Azure テーブルに追加しようとしています。エンティティを追加すると、パーティション キーと行キーの値のみが追加されます。どんな助けでも大歓迎です。これが私のコードです。

class OrderEntity : TableServiceEntity
{
    public int customerID;
    public int productID;
    public Double price;
    public String status;
}

その後、別のクラスで

        OrderEntity order = new OrderEntity();
        order.customerID = retrievedCustomer.id;
        order.productID = selectedProduct.id;
        order.price = Convert.ToDouble(selectedProduct.price);
        order.PartitionKey = retrievedCustomer.id.ToString();
        order.RowKey = counter.ToString();
        order.status = "Processing Order";

        serviceContext.AddObject("orders", order);

        // Submit the operation to the table service
        serviceContext.SaveChangesWithRetries();
4

2 に答える 2

4

パブリックフィールドの代わりにプロパティを使用する必要があります。

于 2012-04-06T13:21:37.267 に答える
2

Mark Rendle は正しいです。パブリック プロパティのみがサポートされ、フィールドはサポートされません。

Microsoft クライアントで制限に遭遇したため、代替の Azure テーブル ストレージ クライアントである Lucifure Stash を作成し、多くの高レベルの抽象化を行いました。Lucifure Stash は、64K を超えるデータ列、リスト、配列、列挙、シリアル化、モーフィング、パブリックおよびプライベート プロパティとフィールドなどをサポートします。個人使用は無料で、http: //www.lucifure.com または NuGet.com からダウンロードできます。

于 2012-04-06T16:03:50.517 に答える