我正在尝试使用存储连接字符串将一些测试值插入到 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)