diff --git a/src/Infrastructure/src/EntityFrameworkCore/Uow/EntityFrameworkUnitOfWork.cs b/src/Infrastructure/src/EntityFrameworkCore/Uow/EntityFrameworkUnitOfWork.cs
index 6b849960..b3fec9fb 100644
--- a/src/Infrastructure/src/EntityFrameworkCore/Uow/EntityFrameworkUnitOfWork.cs
+++ b/src/Infrastructure/src/EntityFrameworkCore/Uow/EntityFrameworkUnitOfWork.cs
@@ -7,6 +7,10 @@
namespace Giantnodes.Infrastructure.EntityFrameworkCore.Uow;
+///
+/// Represents a unit of work implementation for Entity Framework Core.
+///
+/// The type of the DbContext class.
public sealed class EntityFrameworkUnitOfWork : UnitOfWork, ITransientDependency
where TDbContext : DbContext
{
@@ -19,6 +23,7 @@ public EntityFrameworkUnitOfWork(IUnitOfWorkExecutor executor, TDbContext databa
_database = database;
}
+ ///
protected override async Task OnBeginAsync(UnitOfWorkOptions options, CancellationToken cancellation = default)
{
if (options.Timeout.HasValue)
@@ -32,6 +37,7 @@ protected override async Task OnBeginAsync(UnitOfWorkOptions options, Cancellati
_transaction = await _database.Database.BeginTransactionAsync(cancellation);
}
+ ///
protected override async Task OnCommitAsync(CancellationToken cancellation = default)
{
var events = _database
diff --git a/src/Infrastructure/src/Infrastructure/Uow/UnitOfWork.cs b/src/Infrastructure/src/Infrastructure/Uow/UnitOfWork.cs
index bf83e339..e77e134d 100644
--- a/src/Infrastructure/src/Infrastructure/Uow/UnitOfWork.cs
+++ b/src/Infrastructure/src/Infrastructure/Uow/UnitOfWork.cs
@@ -11,25 +11,55 @@ public abstract class UnitOfWork : IUnitOfWork
private bool _committed;
private Exception? _exception;
+ ///
+ /// Gets the list of domain events that occurred during the execution of the unit of work.
+ ///
protected List DomainEvents { get; }
+ ///
+ /// Gets the unique correlation identifier for this unit of work.
+ ///
public Guid CorrelationId { get; }
+ ///
+ /// Gets the user identifier associated with this unit of work, or null if not set.
+ ///
public Guid? UserId { get; private set; }
+ ///
+ /// Gets the tenant identifier associated with this unit of work, or null if not set.
+ ///
public Guid? TenantId { get; private set; }
+ ///
+ /// Gets the value indicating whether this unit of work has been disposed.
+ ///
public bool IsDisposed { get; private set; }
+ ///
+ /// Occurs when the unit of work has been successfully committed.
+ ///
public event EventHandler? Completed;
+ ///
+ /// Occurs when an exception is thrown during the execution of the unit of work.
+ ///
public event EventHandler? Failed;
+ ///
+ /// Occurs when the unit of work is disposed.
+ ///
public event EventHandler? Disposed;
+ ///
+ /// Gets the options used to configure the behavior of this unit of work.
+ ///
public UnitOfWorkOptions? Options { get; private set; }
- public IReadOnlyCollection