Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions src/Nullinside.Api.Model/INullinsideContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,56 @@ namespace Nullinside.Api.Model;
/// <summary>
/// Represents the nullinside database.
/// </summary>
public interface INullinsideContext {
public interface INullinsideContext : IAsyncDisposable {
/// <summary>
/// The users table which contains all of the users that have ever authenticated with the site.
/// </summary>
public DbSet<User> Users { get; set; }
DbSet<User> Users { get; set; }

/// <summary>
/// The user's roles table which contains all of the "roles" the user has in the application.
/// </summary>
public DbSet<UserRole> UserRoles { get; set; }
DbSet<UserRole> UserRoles { get; set; }

/// <summary>
/// The docker deployments that are configurable in the applications.
/// </summary>
public DbSet<DockerDeployments> DockerDeployments { get; set; }
DbSet<DockerDeployments> DockerDeployments { get; set; }

/// <summary>
/// The docker deployments that are configurable in the applications.
/// </summary>
public DbSet<TwitchUser> TwitchUser { get; set; }
DbSet<TwitchUser> TwitchUser { get; set; }

/// <summary>
/// The docker deployments that are configurable in the applications.
/// </summary>
public DbSet<TwitchBan> TwitchBan { get; set; }
DbSet<TwitchBan> TwitchBan { get; set; }

/// <summary>
/// The feature toggles.
/// </summary>
public DbSet<FeatureToggle> FeatureToggle { get; set; }
DbSet<FeatureToggle> FeatureToggle { get; set; }

/// <summary>
/// The twitch user configuration.
/// </summary>
public DbSet<TwitchUserConfig> TwitchUserConfig { get; set; }
DbSet<TwitchUserConfig> TwitchUserConfig { get; set; }

/// <summary>
/// The twitch logs of users banned outside the bot.
/// </summary>
public DbSet<TwitchUserBannedOutsideOfBotLogs> TwitchUserBannedOutsideOfBotLogs { get; set; }
DbSet<TwitchUserBannedOutsideOfBotLogs> TwitchUserBannedOutsideOfBotLogs { get; set; }

/// <summary>
/// The twitch logs of the user's chat.
/// </summary>
public DbSet<TwitchUserChatLogs> TwitchUserChatLogs { get; set; }
DbSet<TwitchUserChatLogs> TwitchUserChatLogs { get; set; }

/// <summary>
/// Provides access to database related information and operations for this context.
/// </summary>
public DatabaseFacade Database { get; }
DatabaseFacade Database { get; }

/// <summary>
/// Saves all changes made in this context to the database.
Expand All @@ -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.
/// </returns>
public Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);

/// <summary>
/// Saves all changes made in this context to the database.
/// </summary>
/// <returns>
/// The number of state entries written to the database.
/// </returns>
int SaveChanges();
}
Loading