public void CloseDatabase(DatabaseReference databaseReference) { if (databaseReference == null) { return; } databaseReference?.BeforeDispose(); Databases.Remove(databaseReference); databaseReference?.Dispose(); }