public void AddToCache <T>(T objectToCache, string cacheKey) where T : class { switch (Type) { case CacheType.Sliding: ObjectCache.AddSliding(objectToCache, cacheKey, Timeout); break; default: ObjectCache.AddAbsolute(objectToCache, cacheKey, Timeout); break; } }