我正在尝试将订单实体添加到 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();