From the course: ASP.NET Core: Working with Azure Tables

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Deleting an entity from Azure Table storage

Deleting an entity from Azure Table storage - ASP.NET Core Tutorial

From the course: ASP.NET Core: Working with Azure Tables

Start my 1-month free trial

Deleting an entity from Azure Table storage

- [Instructor] The only table operation that we are currently missing is the delete operation, which we can use to remove entity data from an Azure table. Well, let us see it in action by going to Visual Studio. In here, go to the operations.CS file, and then scroll down to the bottom. Here, copy the last method, which is the retrieve single data operation. And I just paste it in here. We are going to change the name to DeleteDataOperation. It will take two parameters, the first one will be the CloudTable and the second one, the EmployeeEntity. So employee, or just entity. Next, we need to construct the table operation. The table operation is going to be a delete operation, and then in here we have TableOperation.delete, and pass as a parameter the entity that you want to delete. Now, this entity will have the RowKey and also the PartitionKey that will be used by Azure when removing this entity. So we have the delete…

Contents