Make DatabaseManager an instance #86

Closed
opened 3 months ago by kimimaru · 1 comments
Owner

Make DatabaseManager an instance instead of a static class. Add a new IDatabaseManager<T> interface that it implements with BotDBContext as the generic type used. The type in the interface should be constrained to DbContext.

Finally, inject this instance to classes that need it. This will make it possible to properly test it.

Make `DatabaseManager` an instance instead of a static class. Add a new `IDatabaseManager<T>` interface that it implements with `BotDBContext` as the generic type used. The type in the interface should be constrained to `DbContext`. Finally, inject this instance to classes that need it. This will make it possible to properly test it.
kimimaru added the
refactor
label 3 months ago
kimimaru added this to the TRBot 2.4 project 3 months ago
Poster
Owner

Completed in 5a4dfa5305.

Completed in https://codeberg.org/kimimaru/TRBot/commit/5a4dfa530528023e0d799fe5538c192962110632.
kimimaru closed this issue 3 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.