Azure 表将行插入 TableServiceContext

标签 azure cloud azure-table-storage

[输入 azure 表 noob] 我能找到的有关 Azure 表存储的所有文章都指定了 Microsoft.WindowsAzure.StorageClient 中与 TableServiceContext 类相关的 AddObject 方法。不幸的是,当我尝试引用AddObject和SaveChanges方法时,VS说没有这样的方法。这是我的代码:

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
                    RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString")
                );

CloudTableClient tableClient = new CloudTableClient(storageAccount.TableEndpoint.ToString(), storageAccount.Credentials);
                tableClient.CreateTableIfNotExist("ODATImageResizeErrors");

TableServiceContext context = tableClient.GetDataServiceContext();

ImageResizeErrorEntity entity = new ImageResizeErrorEntity();

entity.ErrorDescription = "Error resizing image";
entity.InnerException = ex.InnerException.ToString();
entity.ImageTypeId = imageTypeId;
entity.SkuId = skuId;
entity.RowKey = Guid.NewGuid().ToString();
entity.PartitionKey = "Errors";

这是我收到的完整错误: Table Insert Error

感谢您的帮助 P.S.:我确实确保我的 Windows Azure SDK 是最新的,我的 StorageClient DLL 是 v1.1.0.0

最佳答案

您是否有对 System.Data.Services.Client.dll 的引用以及它的 using 声明?

关于Azure 表将行插入 TableServiceContext,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10420164/

相关文章:

azure - kubectl错误: You must be logged in to the server (Unauthorized) after some time in AKS

azure - Windows Azure Solr和hadoop数据

azure - 有两个azure应用程序服务具有相同的IP正常吗?

c# - 如何在.Net Core中使用REST API访问azure表存储

java - 无法在 Azure RHEL 节点中使用 yum 访问第三方存储库

c# - Power Bi 嵌入 token 和错误 PowerBIEntityNotFound

design-patterns - 您在以云为中心的设计中遇到过哪些架构问题?

cloud - 谷歌云在虚拟机之间共享数据

c# - Windows Azure 表,使用 Contains 进行查询

Azure表: how to use partition key and row key when entities have only one key?