Skip to content

Commit e68c404

Browse files
committed
[edit] methods description
[r] to primary constructors [edit] according to methods rename [up] deps
1 parent 97a44ca commit e68c404

File tree

10 files changed

+52
-43
lines changed

10 files changed

+52
-43
lines changed

src/Simplify.Repository.EntityFramework/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [0.3.0] - 2023-01-14
4+
5+
### Dependencies
6+
7+
- Simplify.Repository bump to 1.7
8+
- Microsoft.EntityFrameworkCore.Relational bump to 5.0.17
9+
- Simplify.DI bump to 4.2.10
10+
311
## [0.2.0] - 2022-01-24
412

513
### Added

src/Simplify.Repository.EntityFramework/GenericRepository.cs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,17 @@ namespace Simplify.Repository.EntityFramework;
1111
/// Provides generic repository pattern for easy Entity Framework repositories implementation
1212
/// </summary>
1313
/// <typeparam name="T"></typeparam>
14-
public class GenericRepository<T> : IGenericRepository<T>
14+
/// <remarks>
15+
/// Initializes a new instance of the <see cref="GenericRepository{T}"/> class.
16+
/// </remarks>
17+
/// <param name="session">The session.</param>
18+
public class GenericRepository<T>(DbContext session) : IGenericRepository<T>
1519
where T : class
1620
{
1721
/// <summary>
1822
/// The NHibernate session
1923
/// </summary>
20-
protected readonly DbContext Session;
21-
22-
/// <summary>
23-
/// Initializes a new instance of the <see cref="GenericRepository{T}"/> class.
24-
/// </summary>
25-
/// <param name="session">The session.</param>
26-
public GenericRepository(DbContext session) => Session = session;
24+
protected readonly DbContext Session = session;
2725

2826
/// <summary>
2927
/// Gets the single object by identifier.
@@ -68,12 +66,12 @@ public class GenericRepository<T> : IGenericRepository<T>
6866
public Task<T> GetFirstByQueryAsync(Expression<Func<T, bool>> query) => Session.Set<T>().FirstOrDefaultAsync(query)!;
6967

7068
/// <summary>
71-
/// Gets the multiple objects by query.
69+
/// Gets the multiple objects by query or all objects without query.
7270
/// </summary>
7371
/// <param name="query">The query.</param>
7472
/// <param name="customProcessing">The custom processing.</param>
7573
/// <returns></returns>
76-
public IList<T> GetMultipleByQuery(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
74+
public IList<T> GetMultiple(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
7775
{
7876
var queryable = Session.Set<T>().AsQueryable();
7977

@@ -87,12 +85,12 @@ public IList<T> GetMultipleByQuery(Expression<Func<T, bool>>? query = null, Func
8785
}
8886

8987
/// <summary>
90-
/// Gets the multiple objects by query asynchronously.
88+
/// Gets the multiple objects by query or all objects without query asynchronously.
9189
/// </summary>
9290
/// <param name="query">The query.</param>
9391
/// <param name="customProcessing">The custom processing.</param>
9492
/// <returns></returns>
95-
public async Task<IList<T>> GetMultipleByQueryAsync(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
93+
public async Task<IList<T>> GetMultipleAsync(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
9694
{
9795
var queryable = Session.Set<T>().AsQueryable();
9896

src/Simplify.Repository.EntityFramework/Simplify.Repository.EntityFramework.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010

11-
<Version>0.3-pre01</Version>
11+
<Version>0.3</Version>
1212

1313
<Authors>Alexander Krylkov</Authors>
1414
<Product>Simplify</Product>
@@ -27,8 +27,8 @@
2727
<ProjectReference Include="..\Simplify.Repository\Simplify.Repository.csproj" />
2828
</ItemGroup>
2929
<ItemGroup>
30-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.7" />
31-
<PackageReference Include="Simplify.DI" Version="4.1.5" />
30+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.17" />
31+
<PackageReference Include="Simplify.DI" Version="4.2.10" />
3232
</ItemGroup>
3333
<ItemGroup>
3434
<None Include="..\..\images\icon.png" Pack="true" Visible="false" PackagePath="" />

src/Simplify.Repository.EntityFramework/TransactUnitOfWork.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@ namespace Simplify.Repository.EntityFramework;
99
/// <summary>
1010
/// Provides unit of work with manual open transaction
1111
/// </summary>
12-
public class TransactUnitOfWork<T> : UnitOfWork<T>, ITransactUnitOfWork
12+
/// <remarks>
13+
/// Initializes a new instance of the <see cref="TransactUnitOfWork{T}"/> class.
14+
/// </remarks>
15+
/// <param name="context">The context.</param>
16+
public class TransactUnitOfWork<T>(DbContext context) : UnitOfWork<T>(context), ITransactUnitOfWork
1317
where T : DbContext
1418
{
1519
private IDbContextTransaction? _transaction;
1620

17-
/// <summary>
18-
/// Initializes a new instance of the <see cref="TransactUnitOfWork{T}"/> class.
19-
/// </summary>
20-
/// <param name="context">The context.</param>
21-
public TransactUnitOfWork(DbContext context) : base(context)
22-
{
23-
}
24-
2521
/// <summary>
2622
/// Gets a value indicating whether UoW's transaction is active.
2723
/// </summary>

src/Simplify.Repository.FluentNHibernate/CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# Changelog
22

3-
## [1.6] - 2023-08-07
3+
## [1.7.0] - 2024-01-14
4+
5+
### Dependencies
6+
7+
- Simplify.Repository bump to 1.7
8+
- Simplify.FluentNHibernate bump to 3.0
9+
10+
## [1.6.0] - 2023-08-07
411

512
### Removed
613

714
- .NET 4.6.2 support
8-
- SessionFactoryBuilderBase moved from Simplify.Repository.FluentNHibernate (¹481)
15+
- SessionFactoryBuilderBase moved from Simplify.Repository.FluentNHibernate (481)
916

1017
### Added
1118

src/Simplify.Repository.FluentNHibernate/GenericRepository.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ public class GenericRepository<T> : IGenericRepository<T>
6969
public Task<T> GetFirstByQueryAsync(Expression<Func<T, bool>> query) => Session.GetFirstObjectAsync(query);
7070

7171
/// <summary>
72-
/// Gets the multiple objects by query.
72+
/// Gets the multiple objects by query or all objects without query.
7373
/// </summary>
7474
/// <param name="query">The query.</param>
7575
/// <param name="customProcessing">The custom processing.</param>
7676
/// <returns></returns>
77-
public IList<T> GetMultipleByQuery(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
77+
public IList<T> GetMultiple(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
7878
=> Session.GetList(query, customProcessing);
7979

8080
/// <summary>
81-
/// Gets the multiple objects by query asynchronously.
81+
/// Gets the multiple objects by query or all objects without query asynchronously.
8282
/// </summary>
8383
/// <param name="query">The query.</param>
8484
/// <param name="customProcessing">The custom processing.</param>
8585
/// <returns></returns>
86-
public Task<IList<T>> GetMultipleByQueryAsync(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
86+
public Task<IList<T>> GetMultipleAsync(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
8787
=> Session.GetListAsync(query, customProcessing);
8888

8989
/// <summary>

src/Simplify.Repository.FluentNHibernate/Simplify.Repository.FluentNHibernate.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010

11-
<Version>1.6</Version>
11+
<Version>1.7</Version>
1212

1313
<Authors>Alexander Krylkov</Authors>
1414
<Product>Simplify</Product>

src/Simplify.Repository.FluentNHibernate/StatelessGenericRepository.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,21 @@ public class StatelessGenericRepository<T> : IGenericRepository<T>
7777
public Task<T> GetFirstByQueryAsync(Expression<Func<T, bool>> query) => Session.GetFirstObjectAsync(query);
7878

7979
/// <summary>
80-
/// Gets the multiple objects by query.
80+
/// Gets the multiple objects by query or all objects without query.
8181
/// </summary>
8282
/// <param name="query">The query.</param>
8383
/// <param name="customProcessing">The custom processing.</param>
8484
/// <returns></returns>
85-
public IList<T> GetMultipleByQuery(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
85+
public IList<T> GetMultiple(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
8686
=> Session.GetList(query, customProcessing);
8787

8888
/// <summary>
89-
/// Gets the multiple objects by query asynchronously.
89+
/// Gets the multiple objects by query or all objects without query asynchronously.
9090
/// </summary>
9191
/// <param name="query">The query.</param>
9292
/// <param name="customProcessing">The custom processing.</param>
9393
/// <returns></returns>
94-
public Task<IList<T>> GetMultipleByQueryAsync(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
94+
public Task<IList<T>> GetMultipleAsync(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
9595
=> Session.GetListAsync(query, customProcessing);
9696

9797
/// <summary>

src/Simplify.Repository/IGenericRepository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ public interface IGenericRepository<T>
5656
Task<T> GetFirstByQueryAsync(Expression<Func<T, bool>> query);
5757

5858
/// <summary>
59-
/// Gets the multiple objects by query.
59+
/// Gets the multiple objects by query or all objects without query.
6060
/// </summary>
6161
/// <param name="query">The query.</param>
6262
/// <param name="customProcessing">The custom processing.</param>
6363
/// <returns></returns>
6464
IList<T> GetMultiple(Expression<Func<T, bool>>? query = null, Func<IQueryable<T>, IQueryable<T>>? customProcessing = null);
6565

6666
/// <summary>
67-
/// Gets the multiple objects by query asynchronously.
67+
/// Gets the multiple objects by query or all objects without query asynchronously.
6868
/// </summary>
6969
/// <param name="query">The query.</param>
7070
/// <param name="customProcessing">The custom processing.</param>

src/Simplify.Repository/TransactGenericRepository`1.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,12 @@ public async Task<long> GetLongCountAsync(Expression<Func<T, bool>>? query = nul
251251
}
252252

253253
/// <summary>
254-
/// Gets the multiple objects by query.
254+
/// Gets the multiple objects by query or all objects without query.
255255
/// </summary>
256256
/// <param name="query">The query.</param>
257257
/// <param name="customProcessing">The custom processing.</param>
258258
/// <returns></returns>
259-
public IList<T> GetMultipleByQuery(Expression<Func<T, bool>>? query = null,
259+
public IList<T> GetMultiple(Expression<Func<T, bool>>? query = null,
260260
Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
261261
{
262262
var skip = false;
@@ -266,7 +266,7 @@ public IList<T> GetMultipleByQuery(Expression<Func<T, bool>>? query = null,
266266
else
267267
_unitOfWork.BeginTransaction(_isolationLevel);
268268

269-
var result = _baseRepository.GetMultipleByQuery(query, customProcessing);
269+
var result = _baseRepository.GetMultiple(query, customProcessing);
270270

271271
if (!skip)
272272
_unitOfWork.Commit();
@@ -275,12 +275,12 @@ public IList<T> GetMultipleByQuery(Expression<Func<T, bool>>? query = null,
275275
}
276276

277277
/// <summary>
278-
/// Gets the multiple objects by query asynchronously.
278+
/// Gets the multiple objects by query or all objects without query asynchronously.
279279
/// </summary>
280280
/// <param name="query">The query.</param>
281281
/// <param name="customProcessing">The custom processing.</param>
282282
/// <returns></returns>
283-
public async Task<IList<T>> GetMultipleByQueryAsync(Expression<Func<T, bool>>? query = null,
283+
public async Task<IList<T>> GetMultipleAsync(Expression<Func<T, bool>>? query = null,
284284
Func<IQueryable<T>, IQueryable<T>>? customProcessing = null)
285285
{
286286
var skip = false;
@@ -290,7 +290,7 @@ public async Task<IList<T>> GetMultipleByQueryAsync(Expression<Func<T, bool>>? q
290290
else
291291
_unitOfWork.BeginTransaction(_isolationLevel);
292292

293-
var result = await _baseRepository.GetMultipleByQueryAsync(query, customProcessing);
293+
var result = await _baseRepository.GetMultipleAsync(query, customProcessing);
294294

295295
if (!skip)
296296
await _unitOfWork.CommitAsync();

0 commit comments

Comments
 (0)