#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Repositories.Authorization;
using Lumina.Application.Common.DataAccess.Repositories.Books;
using Lumina.Application.Common.DataAccess.Repositories.MediaLibrary;
using Lumina.Application.Common.DataAccess.Repositories.Plugins;
using Lumina.Application.Common.DataAccess.Repositories.Themes;
using Lumina.Application.Common.DataAccess.Repositories.Users;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Application.Common.DataAccess.UoW;
///
/// Interaction boundary with the Data Access Layer.
///
public interface IUnitOfWork
{
///
/// Gets the permission repository.
///
IPermissionRepository PermissionRepository { get; }
///
/// Gets the role permission repository.
///
IRolePermissionRepository RolePermissionRepository { get; }
///
/// Gets the role repository.
///
IRoleRepository RoleRepository { get; }
///
/// Gets the role user repository.
///
IUserRoleRepository UserRoleRepository { get; }
///
/// Gets the book repository.
///
IBookRepository BookRepository { get; }
///
/// Gets the directory scan fingerprint repository.
///
IDirectoryScanFingerprintRepository DirectoryScanFingerprintRepository { get; }
///
/// Gets the library repository.
///
ILibraryRepository LibraryRepository { get; }
///
/// Gets the library scan repository.
///
ILibraryScanRepository LibraryScanRepository { get; }
///
/// Gets the library scan snapshot repository.
///
ILibraryScanSnapshotRepository LibraryScanSnapshotRepository { get; }
///
/// Gets the library scan staging results repository.
///
ILibraryScanStagingResultsRepository LibraryScanStagingResultsRepository { get; }
///
/// Gets the library metadata provider configuration repository.
///
ILibraryMetadataProviderConfigurationRepository LibraryMetadataProviderConfigurationRepository { get; }
///
/// Gets the library artwork provider configuration repository.
///
IArtworkProviderConfigurationRepository ArtworkProviderConfigurationRepository { get; }
///
/// Gets the plugin repository.
///
IPluginRepository PluginRepository { get; }
///
/// Gets the theme repository.
///
IThemeRepository ThemeRepository { get; }
///
/// Gets the user repository.
///
IUserRepository UserRepository { get; }
///
/// Gets the user settings repository.
///
IUserSettingsRepository UserSettingsRepository { get; }
///
/// Saves all changes made to the database.
///
/// Cancellation token that can be used to stop the execution.
Task SaveChangesAsync(CancellationToken cancellationToken);
///
/// Detaches all the entities tracked by the unit of work, freeing the memory they occupy.
///
void ClearTrackedEntities();
///
/// Begins a new database transaction.
///
/// Cancellation token that can be used to stop the execution.
/// A task representing the asynchronous operation.
Task BeginTransactionAsync(CancellationToken cancellationToken);
///
/// Commits the current transaction.
///
/// Cancellation token that can be used to stop the execution.
/// A task representing the asynchronous operation.
Task CommitTransactionAsync(CancellationToken cancellationToken);
///
/// Rolls back the current transaction.
///
/// Cancellation token that can be used to stop the execution.
/// A task representing the asynchronous operation.
Task RollbackTransactionAsync(CancellationToken cancellationToken);
}