Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDatabaseClient should implement IDisposable #29

Closed
jiri-matejka opened this issue Dec 6, 2024 · 1 comment
Closed

IDatabaseClient should implement IDisposable #29

jiri-matejka opened this issue Dec 6, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@jiri-matejka
Copy link

jiri-matejka commented Dec 6, 2024

Interface IDatabaseClient should implement IDisposable because its implementation, DatabaseWrapper, is disposable:

internal class DatabaseWrapper : IDatabaseClient, IDisposable

Currently I cannot use using statement since IDatabaseClient returned from await DatabaseClient.Create(...) is not disposable.

The only thing what I can do is

var dbClient = await DatabaseClient.Create();
try
{
   await dbClient.Execute(...);
}
finally
{
  ((IDisposable)dbClient).Dispose();
}
@jiri-matejka jiri-matejka changed the title IDatabaseClient should implement Disposable IDatabaseClient should implement IDisposable Dec 6, 2024
@tvandinther tvandinther added bug Something isn't working good first issue Good for newcomers labels Dec 6, 2024
@tvandinther tvandinther added this to the Version 1.0 milestone Dec 6, 2024
@tvandinther
Copy link
Owner

Fixed in #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants