Files
OurUmbraco/uForum/Singleton.cs
T
2015-01-19 22:01:06 +01:00

21 lines
413 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace uForum
{
public class Singleton<T> where T : class, new()
{
Singleton() { }
private static readonly Lazy<T> instance = new Lazy<T>(() => new T());
public static T UniqueInstance
{
get { return instance.Value; }
}
}
}