RedisRepository 分享和纠错(7)

public async Task<bool> DoInTranscationAsync(Action<ITransaction> runOperations) { var tran = RedisConnection.GenerateConnection.GetDatabase().CreateTransaction(); runOperations(tran); return await tran.ExecuteAsync(); }

RedisFactory.cs

using Fantasy.RedisRepository.RedisHelpers; namespace Fantasy.RedisRepository { public class RedisFactory { /// <summary> /// 外部访问redis入口,暂时只暴露异步方法 /// </summary> /// <returns></returns> public static IRedisHelper CreateRedisRepository() { return new RedisHelper(); } } }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdppwx.html