小编sai*_*mar的帖子

无法转换为 microsoft.azure.cosmosDB.table.itableentity

我正在尝试使用存储连接字符串将一些测试值插入到 Azure 表中。当我尝试执行插入操作时,它显示错误,因为无法将 TableStorage.RunnerInputs 转换为 Microsoft.azure.cosmosDB.table.itableentity。我正在参考https://learn.microsoft.com/en-us/azure/cosmos-db/table-storage-how-to-use-dotnet来解决这个问题

*


        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
 CloudConfigurationManager.GetSetting("StorageConnectionString"));

        //Create the table client.
               CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

        //Create the CloudTable object that represents the "people" table.
       CloudTable table = tableClient.GetTableReference("InputParameters");

        table.CreateIfNotExists();

        //Create a new customer entity.
       RunnerInputs RunnerInput = new RunnerInputs("OnlyDate", "rowkey");

        //CloudTable test = null;


        RunnerInput.InputDate = "20180213";


        //Inputvalue = "20180213";
        //Create the TableOperation object that inserts the customer entity.
               TableOperation insertOperation = TableOperation.Insert(RunnerInput);

        //Execute the insert operation.
               table.Execute(insertOperation);
Run Code Online (Sandbox Code Playgroud)

跑者级别

namespace TableStorage
{
 public  class …
Run Code Online (Sandbox Code Playgroud)

.net c# azure azure-storage azure-web-app-service

1
推荐指数
1
解决办法
2731
查看次数

标签 统计

.net ×1

azure ×1

azure-storage ×1

azure-web-app-service ×1

c# ×1