示例#1
0
        /// <summary>
        /// 初始化业务锁测试服务
        /// </summary>
        static LockTestService()
        {
            var services = new ServiceCollection();

            services.AddEasyCaching();
            services.AddDefaultInMemoryCache();
            var serviceProvider = services.BuildServiceProvider();
            var cache           = serviceProvider.GetService <ICache>();

            Lock = new DefaultLock(cache);
        }
示例#2
0
 /// <summary>
 /// 初始化业务锁测试服务
 /// </summary>
 public LockTestService()
 {
     _lock = new DefaultLock(Cache);
 }