public TagTransactionMessageEntity(TagTransactionEntity tagTransaction, string message) { this.PartitionKey = TagTransactionMessageEntity.CalculatePartitionKey(tagTransaction.Channel, tagTransaction.Id); this.RowKey = TagTransactionMessageEntity.CalculateRowKey(); this.Channel = tagTransaction.Channel; this.Id = tagTransaction.Id; this.Operation = tagTransaction.Operation; this.Message = (message.Length > MaxMessageLength) ? message.Substring(0, MaxMessageLength) : message; }
public async Task AddTagTransactionErrorMessageAsync(TagTransactionEntity entity, string message) { var change = this.Batch(); if (entity.TryUpdateOperation(TagTransactionOperation.Error)) { var errorEntity = entity.AsError(); change.Update(errorEntity); } var messageEntity = new TagTransactionMessageEntity(entity, message); change.Create(messageEntity); await change.WhenAll(); }