-
I am migrating from
Microsoft.WindowsAzure.Storage.Table
in the (now obsolete)WindowsAzure.Storage
NuGet package toAzure.Data.Tables
and I can see that there are places whereDynamicTableEntity
is being used in my project. -
But
DynamicTableEntity
is not present in theAzure.Data.Tables
NuGet package, onlyTableEntity
andITableEntity
.-
TableEntity
is available in:- WindowsAzure.Storage at
Microsoft.WindowsAzure.Storage.Table.TableEntity
- Microsoft.Azure.Cosmos.Table at
Microsoft.Azure.Cosmos.Table.TableEntity
- Microsoft.Azure.CosmosDB.Table at
Microsoft.Azure.CosmosDB.Table.TableEntity
. - Azure.Data.Tables at
Azure.Data.Tables.TableEntity
.
- WindowsAzure.Storage at
-
DynamicTableEntity
is available in:- WindowsAzure.Storage at
Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity
- Microsoft.Azure.Cosmos.Table at
Microsoft.Azure.Cosmos.Table.DynamicTableEntity
- Microsoft.Azure.CosmosDB.Table at
Microsoft.Azure.CosmosDB.Table.DynamicTableEntity
. - But not in the Azure.Data.Tables NuGet package.
- WindowsAzure.Storage at
-
-
Is there a difference between
TableEntity
andDynamicTableEntity
? -
I read articles but still don’t understand the relevance:
Azure.Data.Tables
v12 doesn’t have a classDynamicTableEntity
underAzure.Data.Tables
. -
Is there any equivalent class that I can use for the same for the migration?
2
Answers
I am facing the same issue with my code. While reading the Microsoft docs, I found this description of the
TableEntity
type. TheAzure.Data.Tables
TableEntity
class is:This appears to be the replacement for DynamicTableEntity. Furthermore, it implements:
Also, it has type conversion helper methods that can be used in place of the former
EntityProperty
helper methods.https://learn.microsoft.com/en-us/dotnet/api/azure.data.tables.tableentity?view=azure-dotnet
For anyone hitting this later. Here is an example of property updates in the
Azure.Data.Table world.
Note the ETag.All, this will simply blanket update the specified field regardless. Explore other options if you need to check the version of the record you are updating etc. Also note, V used for generic value in this instance as it is a part of a generic class that uses T already.