public void Dispose() { if (ctx != null) { ctx.Dispose(); } }
public void Dispose() { if (context != null) { context.Dispose(); } }
protected virtual void Dispose(bool disposing) { lock (this) { // Do nothing if the object has already been disposed of. if (disposed) { return; } if (disposing) { // Release disposable objects used by this instance here. if (context != null) { context.Dispose(); } } // Release unmanaged resources here. Don't access reference type fields. // Remember that the object has been disposed of. disposed = true; } }