I am currently migrating a project that was written for .NET Fx 4.8 using ASP.NET WebApi to .NET 5.0. This project makes heavy use of the package WindowsAzure.Storage for accessing BLOBs, tables and queues on a Azure Storage account. This package has been deprecated for a while now, stating that is has been split up into several packages.
For Queues and Blobs it is quite clear what I should migrate to. But there seems to be a lot of confusion regarding Azure Tables however.
- First of all in the NuGet package WindowsAzure.Storage it states that the package to use for tables would be Microsoft.Azure.CosmosDB.Table. It's a bit confusing because I always thought that "CosmosDB" is something entirely different than "Azure Tables", but maybe I am wrong.
- The description of Microsoft.Azure.CosmosDB.Table however states that this package is in maintenance mode and will be deprecated. I should use Microsoft.Azure.Cosmos.Table instead.
- Microsoft.Azure.Cosmos.Table however has not been updated for ages and 2.0.0 is in preview for more than two years now. There is also an issue on its GitHub repo that specifically asks if this project is dead - with no answer.
- After searching around, I found the package Azure.Data.Tables to be closest to what I might be looking for. It's updated, looks alive and seems in line (version-number wise) with the other storage packages. Only the naming is a bit off. There's also a blog post from MS in June this year talking about this package being brand new and all, so I guess this is what I was looking for?
Anyway: I found the API of Azure.Data.Tables quite similar to WindowsAzure.Storage, I just had to make a few tweaks here and there.
But what I am totally missing now is the classes QueryComparisons and TableQuery. Are they just gone? Is there are replacement?
An example of the code to migrate would be:
var part1 =
TableQuery.GenerateFilterConditionForGuid(
nameof(SomeEntity.Id),
QueryComparisons.Equal,
idValue));
var part2 =
TableQuery.GenerateFilterConditionForGuid(
nameof(SomeEntity.Category)
QueryComparisons.Equal,
category));
return TableQuery.CombineFilters(part1, TableOperators.And, part2);