File tree Expand file tree Collapse file tree
src/Simplify.Repository.FluentNHibernate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,18 +9,14 @@ namespace Simplify.Repository.FluentNHibernate;
99/// Provides unit of work with manual stateless session open transaction
1010/// </summary>
1111/// <seealso cref="IUnitOfWork" />
12- public class TransactStatelessUnitOfWork : StatelessUnitOfWork , ITransactUnitOfWork
12+ /// <remarks>
13+ /// Initializes a new instance of the <see cref="StatelessUnitOfWork"/> class.
14+ /// </remarks>
15+ /// <param name="sessionFactory">The session factory.</param>
16+ public class TransactStatelessUnitOfWork ( ISessionFactory sessionFactory ) : StatelessUnitOfWork ( sessionFactory ) , ITransactUnitOfWork
1317{
1418 private ITransaction ? _transaction ;
1519
16- /// <summary>
17- /// Initializes a new instance of the <see cref="StatelessUnitOfWork"/> class.
18- /// </summary>
19- /// <param name="sessionFactory">The session factory.</param>
20- public TransactStatelessUnitOfWork ( ISessionFactory sessionFactory ) : base ( sessionFactory )
21- {
22- }
23-
2420 /// <summary>
2521 /// Gets a value indicating whether UoW's transaction is active.
2622 /// </summary>
@@ -58,6 +54,7 @@ public async Task CommitAsync()
5854 throw new InvalidOperationException ( "Oops! We don't have an active transaction" ) ;
5955
6056 await _transaction . CommitAsync ( ) ;
57+
6158 _transaction . Dispose ( ) ;
6259 _transaction = null ;
6360 }
@@ -85,6 +82,7 @@ public async Task RollbackAsync()
8582 throw new InvalidOperationException ( "Oops! We don't have an active transaction" ) ;
8683
8784 await _transaction . RollbackAsync ( ) ;
85+
8886 _transaction . Dispose ( ) ;
8987 _transaction = null ;
9088 }
Original file line number Diff line number Diff line change @@ -8,18 +8,14 @@ namespace Simplify.Repository.FluentNHibernate;
88/// <summary>
99/// Provides unit of work with manual open transaction
1010/// </summary>
11- public class TransactUnitOfWork : UnitOfWork , ITransactUnitOfWork
11+ /// <remarks>
12+ /// Initializes a new instance of the <see cref="TransactUnitOfWork"/> class.
13+ /// </remarks>
14+ /// <param name="sessionFactory">The session factory.</param>
15+ public class TransactUnitOfWork ( ISessionFactory sessionFactory ) : UnitOfWork ( sessionFactory ) , ITransactUnitOfWork
1216{
1317 private ITransaction ? _transaction ;
1418
15- /// <summary>
16- /// Initializes a new instance of the <see cref="TransactUnitOfWork"/> class.
17- /// </summary>
18- /// <param name="sessionFactory">The session factory.</param>
19- public TransactUnitOfWork ( ISessionFactory sessionFactory ) : base ( sessionFactory )
20- {
21- }
22-
2319 /// <summary>
2420 /// Gets a value indicating whether UoW's transaction is active.
2521 /// </summary>
@@ -59,6 +55,7 @@ public async Task CommitAsync()
5955 throw new InvalidOperationException ( "Oops! We don't have an active transaction" ) ;
6056
6157 await _transaction . CommitAsync ( ) ;
58+
6259 _transaction . Dispose ( ) ;
6360 _transaction = null ;
6461 }
@@ -86,6 +83,7 @@ public async Task RollbackAsync()
8683 throw new InvalidOperationException ( "Oops! We don't have an active transaction" ) ;
8784
8885 await _transaction . RollbackAsync ( ) ;
86+
8987 _transaction . Dispose ( ) ;
9088 _transaction = null ;
9189 }
You can’t perform that action at this time.
0 commit comments