Hello!
I would like to use IncrementValue in Redis Typed Transaction but I always get 0 in return value.
How can I get the icremented value before the transaction commit with typed client?
This is my code:
using (IRedisClient redisClient = this.RedisClientsManager.GetClient())
{
ServiceStack.Redis.Generic.IRedisTypedClient<DataManagementEntity> redisEntity = redisClient.As<DataManagementEntity>();
ServiceStack.Redis.Generic.IRedisList<DataManagementEntity> redisDataManagements = redisEntity.Lists[string.Format(urnDataManagementPattern, entity.Name)];
using (ServiceStack.Redis.Generic.IRedisTypedTransaction<DataManagementEntity> trans = redisEntity.CreateTransaction())
{
trans.QueueCommand(r => entity.Id = r.IncrementValue(string.Format(seqDataManagementPattern, entity.Name)));
trans.QueueCommand(r => r.AddItemToList(redisDataManagements, entity));
trans.Commit();
}
}
Thanks,
Tom