private void Close() { foreach (var p in this.unit2Provider.Values) { IDisposable d = p as IDisposable; if (d != null) d.Dispose(); } }