Files
modernkeepass/ModernKeePass/Services/SingletonServiceBase.cs
2018-06-18 14:58:01 +02:00

15 lines
331 B
C#

using System;
namespace ModernKeePass.Services
{
public abstract class SingletonServiceBase<T> where T : new()
{
protected SingletonServiceBase() { }
private static readonly Lazy<T> LazyInstance =
new Lazy<T>(() => new T());
public static T Instance => LazyInstance.Value;
}
}