我正在尝试将订单实体添加到Azure表。当我添加实体时,它只会添加分区键和行键的值。任何帮助深表感谢。这是我的代码。未将实体添加到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();
非常感谢!我现在就试试,不知道我是怎么忘记的,欢呼 – StevenR 2012-04-06 13:37:09