using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Aitex.Core.Util { [Serializable] public class Singleton where T : class, new() { private static readonly Lazy lazy = new Lazy(() => new T(), true); public static T Instance => lazy.Value; } }