public TryWrite ( |
||
syncData | The table name and current value for the sequence. Also an ETag representing /// the latest reserved value retrieved. The ETag must match the curent stored value for the update/write /// to succeed. | |
리턴 | bool |
public bool TryWrite(OptimisticSyncData syncData)
{
var sequence = SequenceTableProxy.Get(syncData.TableName.GetValidPartitionKey(), syncData.TableName.GetValidRowKey()) ??
CreateSequenceFromSchema(syncData.TableName);
if (sequence.ETag != syncData.ConcurrencyKey)
return false; //caller can get data again and attempt a retry.
sequence.Entity.Properties[PropertyFinalCachedId].StringValue = syncData.Data;
SequenceTableProxy.Update(sequence);
return true;
}