Elisa/Elisa.Common/Utils/Singleton.cs

18 lines
315 B
C#
Raw Permalink Normal View History

namespace Elisa.Common.Utils;
public abstract class Singleton<T> where T : new()
{
static T instance;
public static T Instance
{
get
{
if (instance == null)
instance = new T();
return instance;
}
set => instance = value;
}
}