/// <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); }
/// <summary> /// 初始化业务锁测试服务 /// </summary> public LockTestService() { _lock = new DefaultLock(Cache); }