F. Alt
F. Alt

Reputation: 11

What is the right Entity-Type for Azure Table Storage with Azure App Services

I'm testing the Todo-Item-Example from the Azure-WebSite with Azure App Services and Azure Table Storage.

In the Azure-Download-Example the DataEntity-Class inherit from EntityData, but in all other tutorials the DataEntity-Class inherit from TableEntity and in a Update-Paper from Sep 2015 the DataEntity-Class inherit from StorageData.

Please tell me, what is the right and the newest way.

Backround:

I want to set the partitionKey and the rowKey in the Azure Table Storage.

How could I set the partitionKey and the rowKey with StorageData or EntityData. Only in the TableEntity I can set these keys, but then I have also to implement the ITableData-Interface to use the TodoItem in my TableController.

Upvotes: 1

Views: 365

Answers (2)

Jarvis
Jarvis

Reputation: 691

I switched it to use StorageData instead of EntityData. It implements the same interface, and provides accessors for PartitionKey and RowKey. It can be found in the Microsoft.Azure.Mobile.Server.Storage package.

Upvotes: 0

You'll want to inherit from TableEntity. Please take a look at our Table storage sample code here for an example of a class that inherits from TableEntity:

https://github.com/Azure-Samples/storage-table-dotnet-getting-started/blob/master/TableStorage/Model/CustomerEntity.cs

Upvotes: 2

Related Questions