[转][C#]单例模式之懒加载

private static ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
public static UserInfo Instance { get { return Linstance.Value; } }
private static readonly Lazy<UserInfo> Linstance = new Lazy<UserInfo>(() => return new UserInfo(););
访问时直接访问 Instance 即可。
来自: https://www.cnblogs.com/1zhk/p/5257340.html
原文地址:https://www.cnblogs.com/z5337/p/9139674.html