C# 未将实体添加到Azure表中,但行键和分区键已正确添加
我正在尝试将订单实体添加到Azure表中。当我添加实体时,它只添加分区键和行键的值。非常感谢您的帮助。这是我的密码C# 未将实体添加到Azure表中,但行键和分区键已正确添加,c#,azure,azure-storage,azure-table-storage,C#,Azure,Azure Storage,Azure Table Storage,我正在尝试将订单实体添加到Azure表中。当我添加实体时,它只添加分区键和行键的值。非常感谢您的帮助。这是我的密码 class OrderEntity : TableServiceEntity { public int customerID; public int productID; public Double price; public String status; } 然后在另一节课上 OrderEntity order = new Ord
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();
您需要使用属性而不是公共字段。您需要使用属性而不是公共字段。标记Rendle是正确的,只支持公共属性,不支持公共字段 因为我在Microsoft客户机上遇到了一些限制,所以我编写了另一个Azure表存储客户机Lucifure Stash,它具有许多高级抽象。
Lucifure Stash支持大于64K的数据列、列表、数组、枚举、序列化、变形、公共和私有属性以及字段等。它免费供个人使用,可以从NuGet.com或通过NuGet.com下载。Mark Rendle是正确的,只支持公共属性,不支持字段 因为我在Microsoft客户机上遇到了一些限制,所以我编写了另一个Azure表存储客户机Lucifure Stash,它具有许多高级抽象。
Lucifure Stash支持大于64K的数据列、列表、数组、枚举、序列化、变形、公共和私有属性以及字段等。它是免费供个人使用的,可以从NuGet.com或通过NuGet.com下载。非常感谢!我现在就试试,不知道我怎么忘了,干杯,谢谢!我现在就试试,不知道我怎么忘了,干杯