using System; namespace Aurora.Services { public abstract class BaseService where T : class { private static volatile Lazy _instance = new Lazy(() => CreateInstanceOfT()); public static T Instance { get { return _instance.Value; } } private static T CreateInstanceOfT() { return Activator.CreateInstance(typeof(T), true) as T; } } }