diff --git a/src/Nullinside.Api.Model/INullinsideContext.cs b/src/Nullinside.Api.Model/INullinsideContext.cs index cc0798d..c3a7d10 100644 --- a/src/Nullinside.Api.Model/INullinsideContext.cs +++ b/src/Nullinside.Api.Model/INullinsideContext.cs @@ -8,56 +8,56 @@ namespace Nullinside.Api.Model; /// /// Represents the nullinside database. /// -public interface INullinsideContext { +public interface INullinsideContext : IAsyncDisposable { /// /// The users table which contains all of the users that have ever authenticated with the site. /// - public DbSet Users { get; set; } + DbSet Users { get; set; } /// /// The user's roles table which contains all of the "roles" the user has in the application. /// - public DbSet UserRoles { get; set; } + DbSet UserRoles { get; set; } /// /// The docker deployments that are configurable in the applications. /// - public DbSet DockerDeployments { get; set; } + DbSet DockerDeployments { get; set; } /// /// The docker deployments that are configurable in the applications. /// - public DbSet TwitchUser { get; set; } + DbSet TwitchUser { get; set; } /// /// The docker deployments that are configurable in the applications. /// - public DbSet TwitchBan { get; set; } + DbSet TwitchBan { get; set; } /// /// The feature toggles. /// - public DbSet FeatureToggle { get; set; } + DbSet FeatureToggle { get; set; } /// /// The twitch user configuration. /// - public DbSet TwitchUserConfig { get; set; } + DbSet TwitchUserConfig { get; set; } /// /// The twitch logs of users banned outside the bot. /// - public DbSet TwitchUserBannedOutsideOfBotLogs { get; set; } + DbSet TwitchUserBannedOutsideOfBotLogs { get; set; } /// /// The twitch logs of the user's chat. /// - public DbSet TwitchUserChatLogs { get; set; } + DbSet TwitchUserChatLogs { get; set; } /// /// Provides access to database related information and operations for this context. /// - public DatabaseFacade Database { get; } + DatabaseFacade Database { get; } /// /// Saves all changes made in this context to the database. @@ -67,5 +67,13 @@ public interface INullinsideContext { /// A task that represents the asynchronous save operation. The task result contains the /// number of state entries written to the database. /// - public Task SaveChangesAsync(CancellationToken cancellationToken = default); + Task SaveChangesAsync(CancellationToken cancellationToken = default); + + /// + /// Saves all changes made in this context to the database. + /// + /// + /// The number of state entries written to the database. + /// + int SaveChanges(); } \ No newline at end of file