Domanda

In Azure Table Storage I noticed that DataServiceContext.CreateQuery<T> does not populate the ETag property. Is this expected? Are there any options other then CreateQuery<T> that I can use for ad-hoc queries?

Thanks

È stato utile?

Soluzione

If you're using version 2 and above of the storage client library you can use ExecuteQuery method on the table. Something like below:

var table = storageAccount.CreateCloudTableClient().GetTableReference(tableName);
TableQuery<MyEntity> query = new Microsoft.WindowsAzure.Storage.Table.TableQuery<MyEntity>();
var queryResults = table.ExecuteQuery<MyEntity>(query).Take(5).ToList();

queryResults will contain the list of MyEntity and they will have ETag populated.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top