我正在从表中查询实体,更改它们,然后执行替换操作。替换操作失败,因为 etag 上的 etag 属性为空。我检查了一下,当我从 CreateQuery() 调用中获取实体时,etag 为空,但在我执行 Retrieve() 时填充。有没有办法手动获取etag?
IEnumerable<MyEntity> query = from e in serviceContext.CreateQuery<MyEntity>(tableName)
where e.Id == queryId
select e;
MyEntity entity = query.FirstOrDefault();
// Update the MyEntity object
var replaceOperation = TableOperation.Replace(entity);
MyCloudTableClient.GetTableReference(tableName).Execute(replaceOperation);
// Exception is thrown here that eTag value is null