public class Singleton<T> where T : class, new() { public static T Value { get { return Instance.Value; } } private static class Instance { public static readonly T Value = new T(); } }
posted on 2013-11-14 13:06 JRoger 阅读(146) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 JRoger Powered by .NET 8.0 on Kubernetes