This commit is contained in:
Andre Rodrigues 2013-04-30 15:55:08 +01:00
Родитель 23f1946df8
Коммит 1fbe3bc18a
2 изменённых файлов: 28 добавлений и 7 удалений

Просмотреть файл

@ -586,7 +586,11 @@ TableService.prototype.insertEntity = function (tableName, entityDescriptor, opt
responseObject.insertResponse = null;
if (!responseObject.error) {
responseObject.insertResponse = entityResult.parse(responseObject.response.body.entry);
responseObject.insertResponse.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
if (!responseObject.insertResponse._) {
responseObject.insertResponse._ = {};
}
responseObject.insertResponse._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
}
var finalCallback = function (returnObject) {
@ -641,7 +645,12 @@ TableService.prototype.insertOrReplaceEntity = function (tableName, entityDescri
var processResponseCallback = function (responseObject, next) {
responseObject.insertResponse = null;
if (!responseObject.error) {
entityDescriptor.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
if (!entityDescriptor._) {
entityDescriptor._ = {};
}
entityDescriptor._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
responseObject.entityResponse = entityDescriptor;
}
@ -698,7 +707,11 @@ TableService.prototype.updateEntity = function (table, entityDescriptor, options
var processResponseCallback = function (responseObject, next) {
responseObject.entityResponse = null;
if (!responseObject.error) {
entityDescriptor.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
if (!entityDescriptor._) {
entityDescriptor._ = {};
}
entityDescriptor._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
responseObject.entityResponse = entityDescriptor;
}
@ -755,7 +768,11 @@ TableService.prototype.mergeEntity = function (tableName, entityDescriptor, opti
var processResponseCallback = function (responseObject, next) {
responseObject.entityResponse = null;
if (!responseObject.error) {
entityDescriptor.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
if (!entityDescriptor._) {
entityDescriptor._ = {};
}
entityDescriptor._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
responseObject.entityResponse = entityDescriptor;
}
@ -810,7 +827,11 @@ TableService.prototype.insertOrMergeEntity = function (tableName, entityDescript
var processResponseCallback = function (responseObject, next) {
responseObject.entityResponse = null;
if (!responseObject.error) {
entityDescriptor.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
if (!entityDescriptor._) {
entityDescriptor._ = {};
}
entityDescriptor._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
responseObject.entityResponse = entityDescriptor;
}

Просмотреть файл

@ -468,7 +468,7 @@ suite('tableservice-tests', function () {
assert.notEqual(insertEntity, null);
assert.ok(insertResponse.isSuccessful);
assert.equal(insertResponse.statusCode, HttpConstants.HttpResponseCodes.Created);
var originalEtag = newEntity1['etag'];
var originalEtag = newEntity1._.etag;
newEntity1['otherfield'] = newField;
@ -477,7 +477,7 @@ suite('tableservice-tests', function () {
assert.notEqual(updateEntity2, null);
assert.ok(updateResponse2.isSuccessful);
assert.equal(updateResponse2.statusCode, HttpConstants.HttpResponseCodes.NoContent);
assert.notEqual(newEntity1.etag, originalEtag);
assert.notEqual(newEntity1._.etag, originalEtag);
done();
});