I'm trying to insert some test values into an Azure table using storage connection string. When I tried to perform insert operation it showing error as cannot convert TableStorage.RunnerInputs to Microsoft.azure.cosmosDB.table.itableentity. I'm working on this with the reference to 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);
Runner class
namespace TableStorage
{
public class RunnerInputs:TableEntity
{
public RunnerInputs(string ParameterName,string RowValue)
{
this.PartitionKey = ParameterName;
this.RowKey = RowValue;
}
public string InputDate { get; set; }
}
}
Error Screenshot for reference. Can anyone let me know how can we overcome this? Have tried by casting the value, but the result is same.