using System; using NzbDrone.Common.EnsureThat; namespace NzbDrone.Common.Cache { public interface ICacheManger { ICached GetCache(Type type); ICached GetCache(object host); } public class CacheManger : ICacheManger { private readonly ICached _cache; public CacheManger() { _cache = new Cached(); } public ICached GetCache(Type type) { Ensure.That(() => type).IsNotNull(); return (ICached)_cache.Get(type.FullName, () => new Cached()); } public ICached GetCache(object host) { return GetCache(host.GetType()); } } }