2024-05-27 12:29:01 +00:00
|
|
|
namespace Elisa.Common.Utils;
|
2024-05-25 04:43:43 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|