Method Unlock
Unlock(String, LockHandle)
Unlocks a locked cached item, if the correct LockHandle is specified. If LockHandle is null, it forcefully unlocks a locked cached item.
Declaration
void Unlock(string key, LockHandle lockHandle = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key of the cached item to be unlocked. |
LockHandle | lockHandle | An instance of LockHandle that is generated when the lock is acquired. |
Examples
The following example demonstrates how to unlock a cached item.
ICache cache = CacheManager.GetCache("demoCache");
string key = "Product0";
cache.Unlock(key, lockHandle);