public static void Dispose() { foreach (var name in DbConfiguration.Items.Keys) { var key = string.Concat("__", name, "__"); var ctx = Local.Get(key) as IDbContext; if (ctx != null) { Local.Remove(key); ctx.Dispose(); } } }