public void Should_Remove_Key_And_Give_New_Key() { var cachedKey = GetKeyForCurrentUser(MyTestCacheName); var cachedKey2 = GetKeyForCurrentUser(MyTestCacheName); cachedKey2.ShouldBe(cachedKey); _cachedUniqueKeyPerUser.RemoveKey(MyTestCacheName, AbpSession.TenantId, AbpSession.UserId); var cachedKey3 = GetKeyForCurrentUser(MyTestCacheName); cachedKey3.ShouldNotBe(cachedKey); var cachedKey4 = GetKeyForCurrentUser(MyTestCacheName); cachedKey4.ShouldBe(cachedKey3); }
public void Should_Remove_Key_And_Give_New_Key() { var cachedKey = _cachedUniqueKeyPerUser.GetKey(MyTestCacheName); var cachedKey2 = _cachedUniqueKeyPerUser.GetKey(MyTestCacheName); cachedKey2.ShouldBe(cachedKey); _cachedUniqueKeyPerUser.RemoveKey(MyTestCacheName); var cachedKey3 = _cachedUniqueKeyPerUser.GetKey(MyTestCacheName); cachedKey3.ShouldNotBe(cachedKey); var cachedKey4 = _cachedUniqueKeyPerUser.GetKey(MyTestCacheName); cachedKey4.ShouldBe(cachedKey3); }
private void RemoveCache() { _cachedUniqueKeyPerUser.RemoveKey(CacheName); }
public void HandleEvent(EntityChangedEventData <UserPermissionSetting> eventData) { _cachedUniqueKeyPerUser.RemoveKey(CacheName, eventData.Entity.TenantId, eventData.Entity.UserId); }