/// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="isDisposing">如果应释放托管资源,为 true;否则为 false</param> protected static void Dispose(bool isDisposing) { if (_alreadyDisposed) return; if (isDisposing) { comn = null; _instance = null; //GC.SuppressFinalize(this); } _alreadyDisposed = true; }
/// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="isDisposing">如果应释放托管资源,为 true;否则为 false</param> protected static void Dispose(bool isDisposing) { if (_alreadyDisposed) { return; } if (isDisposing) { comn = null; _instance = null; //GC.SuppressFinalize(this); } _alreadyDisposed = true; }
static DbCommon() { _instance = new DbCommon();; }
/// <summary> /// 切记:引用完类组件后,一定要调用此方法来释放! /// </summary> public static void Dispose() { DbCommon.Dispose(); }
static DbCommon() { _instance = new DbCommon(); ; }