Sai Developers Sai Developers - 1 year ago 118
C# Question

How to do batch operation on Azure Storage Table?

I want to insert Multiple Entities into azure table Using Table Operation

I got all data as a List and I just want to save these details into table.

var registrationDescriptionsList = new List<RegistrationDescription>(allRegistrations);

foreach(var retrivedatafromlist in registrationDescriptionsList)



Answer Source

I found the Solution. Please find the code.

TableBatchOperation batchOperation = new TableBatchOperation();

foreach (var retrivedatafromlist in registrationDescriptionsList)
     NotificationHubServiceBus NhsbObj = new NotificationHubServiceBus();

     var tags = "";

     foreach (var a in retrivedatafromlist.Tags)
         tags = tags + a;

     NhsbObj.PartitionKey = "Sample";
     NhsbObj.RowKey = retrivedatafromlist.RegistrationId;
     NhsbObj.RegistrationId = retrivedatafromlist.RegistrationId;
     NhsbObj.ExpirationDate = retrivedatafromlist.ExpirationTime.ToString();
     NhsbObj.ETag = retrivedatafromlist.ETag;
     NhsbObj.Tags = tags;


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download