File tree Expand file tree Collapse file tree 4 files changed +21
-16
lines changed
Simplify.Repository.EntityFramework
Simplify.Repository.FluentNHibernate Expand file tree Collapse file tree 4 files changed +21
-16
lines changed Original file line number Diff line number Diff line change 22
33## [ 0.3.0] - 2023-01-14
44
5+ ### Added
6+
7+ - Make UnitOfWork.Session protected set to be able to change behavior on child classes (#485 )
8+
59### Dependencies
610
711- Simplify.Repository bump to 1.7
Original file line number Diff line number Diff line change @@ -6,23 +6,22 @@ namespace Simplify.Repository.EntityFramework;
66/// <summary>
77/// Provides unit of work
88/// </summary>
9- public class UnitOfWork < T > : IUnitOfWork
9+ /// <remarks>
10+ /// Initializes a new instance of the <see cref="UnitOfWork{T}" /> class.
11+ /// </remarks>
12+ /// <param name="context">The context.</param>
13+ /// <exception cref="InvalidOperationException">Error opening session, session is null</exception>
14+ public class UnitOfWork < T > ( DbContext context ) : IUnitOfWork
1015 where T : DbContext
1116{
12- /// <summary>
13- /// Initializes a new instance of the <see cref="UnitOfWork{T}" /> class.
14- /// </summary>
15- /// <param name="context">The context.</param>
16- /// <exception cref="System.InvalidOperationException">Error opening session, session is null</exception>
17- public UnitOfWork ( DbContext context ) => Context = context ?? throw new InvalidOperationException ( "Error opening session, session is null" ) ;
1817
1918 /// <summary>
2019 /// Gets the session.
2120 /// </summary>
2221 /// <value>
2322 /// The session.
2423 /// </value>
25- public DbContext Context { get ; }
24+ public DbContext Context { get ; protected set ; } = context ?? throw new InvalidOperationException ( "Error opening session, session is null" ) ;
2625
2726 /// <summary>
2827 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Original file line number Diff line number Diff line change 22
33## [ 1.7.0] - 2024-01-14
44
5+ ### Added
6+
7+ - Make UnitOfWork.Session protected set to be able to change behavior on child classes (#485 )
8+
59### Dependencies
610
711- Simplify.Repository bump to 1.7
Original file line number Diff line number Diff line change @@ -6,22 +6,20 @@ namespace Simplify.Repository.FluentNHibernate;
66/// <summary>
77/// Provides unit of work
88/// </summary>
9- public class UnitOfWork : IUnitOfWork
9+ /// <remarks>
10+ /// Initializes a new instance of the <see cref="UnitOfWork"/> class.
11+ /// </remarks>
12+ /// <param name="sessionFactory">The session factory.</param>
13+ public class UnitOfWork ( ISessionFactory sessionFactory ) : IUnitOfWork
1014{
11- /// <summary>
12- /// Initializes a new instance of the <see cref="UnitOfWork"/> class.
13- /// </summary>
14- /// <param name="sessionFactory">The session factory.</param>
15- public UnitOfWork ( ISessionFactory sessionFactory ) =>
16- Session = sessionFactory . OpenSession ( ) ?? throw new InvalidOperationException ( "Error opening session, session is null" ) ;
1715
1816 /// <summary>
1917 /// Gets the session.
2018 /// </summary>
2119 /// <value>
2220 /// The session.
2321 /// </value>
24- public ISession Session { get ; }
22+ public ISession Session { get ; protected set ; } = sessionFactory . OpenSession ( ) ?? throw new InvalidOperationException ( "Error opening session, session is null" ) ;
2523
2624 /// <summary>
2725 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
You can’t perform that action at this time.
0 commit comments