private void SetKeyExpiry(string key, DateTime expires) { if (KeyCleaner == null) { throw new InvalidOperationException("Expiry date cannot be set if no key cleaner is present"); } KeyCleaner.SetKeyExpiry(key, expires); }
public DateTime?ExpiresOn(string key) { if (KeyCleaner != null) { return(KeyCleaner.GetKeyExpiry(key)); } else { throw new Exception("Cannot get expiry as no KeyCleaner is available"); } }