Implements Data Access Layer

This commit is contained in:
BinaryAlley committed 2024-08-26 23:32:29 +03:00
1 parent b69e59a3d8
commit 8b729cc16c
24 files changed
+1721 -9

No files matched your search

@@ -0,0 +1,32 @@
namespace Lumina.Application.Common.DataAccess.UoW;
/// <summary>
/// Interaction boundary with the Data Access Layer.
/// </summary>
public interface IUnitOfWork
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Exposes a repository of type <typeparamref name="TRepository"/> to the Business Layer.
/// </summary>
/// <typeparam name="TRepository">The type of the exposed repository.</typeparam>
/// <returns>A repository of type <typeparamref name="TRepository"/>.</returns>
TRepository GetRepository<TRepository>();
/// <summary>
/// Saves all changes made to the database.
/// </summary>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
Task SaveChangesAsync(CancellationToken cancellationToken);
/// <summary>
/// Opens a transaction.
/// </summary>
void OpenTransaction();
/// <summary>
/// Commits a transaction.
/// </summary>
void CommitTransaction();
#endregion
}