IFreeSql 增加 IDisposable

This commit is contained in:
28810
2019-04-29 18:22:03 +08:00
parent 163fe89bd4
commit f5a292ef45
10 changed files with 101 additions and 17 deletions

View File

@ -47,5 +47,15 @@ namespace FreeSql.Sqlite {
public void Transaction(Action handler) => Ado.Transaction(handler);
public void Transaction(Action handler, TimeSpan timeout) => Ado.Transaction(handler, timeout);
~SqliteProvider() {
this.Dispose();
}
bool _isdisposed = false;
public void Dispose() {
if (_isdisposed) return;
(this.Ado as AdoProvider).Dispose();
(this.Cache as CacheProvider)?.Dispose();
}
}
}