mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-28 02:27:13 +00:00
22 lines
No EOL
489 B
C#
22 lines
No EOL
489 B
C#
using System;
|
|
using NzbDrone.Common.EnsureThat;
|
|
|
|
namespace NzbDrone.Common.Cache
|
|
{
|
|
public static class CacheManger
|
|
{
|
|
private static readonly ICached<object> Cache;
|
|
|
|
static CacheManger()
|
|
{
|
|
Cache = new Cached<object>();
|
|
}
|
|
|
|
public static ICached<T> GetCache<T>(Type type)
|
|
{
|
|
Ensure.That(() => type).IsNotNull();
|
|
|
|
return (ICached<T>)Cache.Get(type.FullName, () => new Cached<T>());
|
|
}
|
|
}
|
|
} |