Skip to content

Commit 885782d

Browse files
authored
Prepare for publish, version 9.0.0 (#455)
* Prepare for publish, version 9.0.0 * Minor fix in Readme.
1 parent 3f9c647 commit 885782d

File tree

14 files changed

+43
-29
lines changed

14 files changed

+43
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Example implementation in your repository using specifications
3636
```c#
3737
public async Task<List<T>> ListAsync(ISpecification<T> specification, CancellationToken cancellationToken = default)
3838
{
39-
var query = SpecificationEvaluator.GetQuery(DbContext.Set<T>(), specification);
39+
var query = SpecificationEvaluator.Default.GetQuery(_dbContext.Set<T>(), specification);
4040
return await query.ToListAsync(cancellationToken);
4141
}
4242
```

src/Ardalis.Specification.EntityFramework6/Ardalis.Specification.EntityFramework6.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
<Description>EF6 plugin package to Ardalis.Specification containing EF6 evaluator and abstract repository.</Description>
1212
<Summary>EF6 plugin package to Ardalis.Specification containing EF6 evaluator and abstract repository.</Summary>
1313

14-
<Version>8.0.0</Version>
14+
<Version>9.0.0</Version>
1515
<PackageTags>spec;specification;repository;ddd;ef;ef6;entity framework</PackageTags>
1616
<PackageReleaseNotes>
17-
* Added TFM for net6.0
17+
The change log and breaking changes are listed here.
18+
https://github.com/ardalis/Specification/issues/427
1819
</PackageReleaseNotes>
1920
</PropertyGroup>
2021

src/Ardalis.Specification.EntityFramework6/RepositoryBaseOfT.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public virtual async Task<bool> AnyAsync(CancellationToken cancellationToken = d
171171
return await DbContext.Set<T>().AnyAsync(cancellationToken);
172172
}
173173

174-
#if NET6_0_OR_GREATER
174+
#if NET8_0_OR_GREATER
175175
/// <inheritdoc/>
176176
public virtual IAsyncEnumerable<T> AsAsyncEnumerable(ISpecification<T> specification)
177177
{
@@ -184,6 +184,7 @@ public virtual IAsyncEnumerable<T> AsAsyncEnumerable(ISpecification<T> specifica
184184
/// <paramref name="specification"/>.
185185
/// </summary>
186186
/// <param name="specification">The encapsulated query logic.</param>
187+
/// <param name="evaluateCriteriaOnly">It ignores pagination and evaluators that don't affect Count.</param>
187188
/// <returns>The filtered entities as an <see cref="IQueryable{T}"/>.</returns>
188189
protected virtual IQueryable<T> ApplySpecification(ISpecification<T> specification, bool evaluateCriteriaOnly = false)
189190
{

src/Ardalis.Specification.EntityFrameworkCore/Ardalis.Specification.EntityFrameworkCore.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
<Description>EF Core plugin package to Ardalis.Specification containing EF Core evaluator and abstract repository.</Description>
1111
<Summary>EF Core plugin package to Ardalis.Specification containing EF Core evaluator and abstract repository.</Summary>
1212

13-
<Version>8.0.0</Version>
13+
<Version>9.0.0</Version>
1414
<PackageTags>spec;specification;repository;ddd;ef;ef core;entity framework;entity framework core</PackageTags>
1515
<PackageReleaseNotes>
16-
* Added TFMs net6.0, net7.0 and net8.0
16+
The change log and breaking changes are listed here.
17+
https://github.com/ardalis/Specification/issues/427
1718
</PackageReleaseNotes>
1819
</PropertyGroup>
1920

src/Ardalis.Specification.EntityFrameworkCore/ContextFactoryRepositoryBaseOfT.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ public async Task<int> SaveChangesAsync(TContext dbContext, CancellationToken ca
204204
/// <paramref name="specification"/>.
205205
/// </summary>
206206
/// <param name="specification">The encapsulated query logic.</param>
207+
/// <param name="dbContext">The DbContext instance.</param>
208+
/// <param name="evaluateCriteriaOnly">It ignores pagination and evaluators that don't affect Count.</param>
207209
/// <returns>The filtered entities as an <see cref="IQueryable{T}"/>.</returns>
208210
protected virtual IQueryable<TEntity> ApplySpecification(ISpecification<TEntity> specification, TContext dbContext, bool evaluateCriteriaOnly = false)
209211
{
@@ -219,6 +221,7 @@ protected virtual IQueryable<TEntity> ApplySpecification(ISpecification<TEntity>
219221
/// </summary>
220222
/// <typeparam name="TResult">The type of the value returned by the projection.</typeparam>
221223
/// <param name="specification">The encapsulated query logic.</param>
224+
/// <param name="dbContext">The DbContext instance.</param>
222225
/// <returns>The filtered projected entities as an <see cref="IQueryable{T}"/>.</returns>
223226
protected virtual IQueryable<TResult> ApplySpecification<TResult>(ISpecification<TEntity, TResult> specification, TContext dbContext)
224227
{

src/Ardalis.Specification.EntityFrameworkCore/RepositoryBaseOfT.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ public virtual IAsyncEnumerable<T> AsAsyncEnumerable(ISpecification<T> specifica
177177
/// <paramref name="specification"/>.
178178
/// </summary>
179179
/// <param name="specification">The encapsulated query logic.</param>
180+
/// <param name="evaluateCriteriaOnly">It ignores pagination and evaluators that don't affect Count.</param>
180181
/// <returns>The filtered entities as an <see cref="IQueryable{T}"/>.</returns>
181182
protected virtual IQueryable<T> ApplySpecification(ISpecification<T> specification, bool evaluateCriteriaOnly = false)
182183
{

src/Ardalis.Specification/Ardalis.Specification.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
<Description>A simple package with a base Specification class, for use in creating queries that work with Repository types.</Description>
1111
<Summary>A simple package with a base Specification class, for use in creating queries that work with Repository types.</Summary>
1212

13-
<Version>8.0.0</Version>
13+
<Version>9.0.0</Version>
1414
<PackageTags>spec;specification;repository;ddd</PackageTags>
1515
<PackageReleaseNotes>
16-
* Added TFMs net6.0, net7.0 and net8.0
16+
The change log and breaking changes are listed here.
17+
https://github.com/ardalis/Specification/issues/427
1718
</PackageReleaseNotes>
1819
</PropertyGroup>
1920

src/Ardalis.Specification/Evaluators/ISpecificationEvaluator.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public interface ISpecificationEvaluator
99
/// Applies the logic encapsulated by <paramref name="specification"/> to given <paramref name="inputQuery"/>,
1010
/// and projects the result into <typeparamref name="TResult"/>.
1111
/// </summary>
12+
/// <typeparam name="T">The type of the entity.</typeparam>
1213
/// <typeparam name="TResult">The type of the result.</typeparam>
1314
/// <param name="inputQuery">The sequence of <typeparamref name="T"/></param>
1415
/// <param name="specification">The encapsulated query logic.</param>
@@ -17,8 +18,10 @@ public interface ISpecificationEvaluator
1718
/// <summary>
1819
/// Applies the logic encapsulated by <paramref name="specification"/> to given <paramref name="inputQuery"/>.
1920
/// </summary>
21+
/// <typeparam name="T">The type of the entity.</typeparam>
2022
/// <param name="inputQuery">The sequence of <typeparamref name="T"/></param>
2123
/// <param name="specification">The encapsulated query logic.</param>
24+
/// <param name="evaluateCriteriaOnly">It ignores pagination and evaluators that don't affect Count.</param>
2225
/// <returns>A filtered sequence of <typeparamref name="T"/></returns>
2326
IQueryable<T> GetQuery<T>(IQueryable<T> inputQuery, ISpecification<T> specification, bool evaluateCriteriaOnly = false) where T : class;
2427
}

src/Ardalis.Specification/IEntity.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/Ardalis.Specification/IReadRepositoryBase.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public interface IReadRepositoryBase<T> where T : class
1414
/// </summary>
1515
/// <typeparam name="TId">The type of primary key.</typeparam>
1616
/// <param name="id">The value of the primary key for the entity to be found.</param>
17-
/// <param name="cancellationToken"></param>
17+
/// <param name="cancellationToken">The cancellation token.</param>
1818
/// <returns>
1919
/// A task that represents the asynchronous operation.
2020
/// The task result contains the <typeparamref name="T" />, or <see langword="null"/>.
@@ -25,7 +25,7 @@ public interface IReadRepositoryBase<T> where T : class
2525
/// Returns the first element of a sequence, or a default value if the sequence contains no elements.
2626
/// </summary>
2727
/// <param name="specification">The encapsulated query logic.</param>
28-
/// <param name="cancellationToken">A <see cref="CancellationToken" /> to observe while waiting for the task to complete.</param>
28+
/// <param name="cancellationToken">The cancellation token.</param>
2929
/// <returns>
3030
/// A task that represents the asynchronous operation.
3131
/// The task result contains the <typeparamref name="T" />, or <see langword="null"/>.
@@ -36,7 +36,7 @@ public interface IReadRepositoryBase<T> where T : class
3636
/// Returns the first element of a sequence, or a default value if the sequence contains no elements.
3737
/// </summary>
3838
/// <param name="specification">The encapsulated query logic.</param>
39-
/// <param name="cancellationToken">A <see cref="CancellationToken" /> to observe while waiting for the task to complete.</param>
39+
/// <param name="cancellationToken">The cancellation token.</param>
4040
/// <returns>
4141
/// A task that represents the asynchronous operation.
4242
/// The task result contains the <typeparamref name="TResult" />, or <see langword="null"/>.
@@ -47,7 +47,7 @@ public interface IReadRepositoryBase<T> where T : class
4747
/// Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.
4848
/// </summary>
4949
/// <param name="specification">The encapsulated query logic.</param>
50-
/// <param name="cancellationToken">A <see cref="CancellationToken" /> to observe while waiting for the task to complete.</param>
50+
/// <param name="cancellationToken">The cancellation token.</param>
5151
/// <returns>
5252
/// A task that represents the asynchronous operation.
5353
/// The task result contains the <typeparamref name="T" />, or <see langword="null"/>.
@@ -58,7 +58,7 @@ public interface IReadRepositoryBase<T> where T : class
5858
/// Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.
5959
/// </summary>
6060
/// <param name="specification">The encapsulated query logic.</param>
61-
/// <param name="cancellationToken">A <see cref="CancellationToken" /> to observe while waiting for the task to complete.</param>
61+
/// <param name="cancellationToken">The cancellation token.</param>
6262
/// <returns>
6363
/// A task that represents the asynchronous operation.
6464
/// The task result contains the <typeparamref name="TResult" />, or <see langword="null"/>.
@@ -68,6 +68,7 @@ public interface IReadRepositoryBase<T> where T : class
6868
/// <summary>
6969
/// Finds all entities of <typeparamref name="T" /> from the database.
7070
/// </summary>
71+
/// <param name="cancellationToken">The cancellation token.</param>
7172
/// <returns>
7273
/// A task that represents the asynchronous operation.
7374
/// The task result contains a <see cref="List{T}" /> that contains elements from the input sequence.
@@ -79,6 +80,7 @@ public interface IReadRepositoryBase<T> where T : class
7980
/// <paramref name="specification"/>, from the database.
8081
/// </summary>
8182
/// <param name="specification">The encapsulated query logic.</param>
83+
/// <param name="cancellationToken">The cancellation token.</param>
8284
/// <returns>
8385
/// A task that represents the asynchronous operation.
8486
/// The task result contains a <see cref="List{T}" /> that contains elements from the input sequence.
@@ -94,6 +96,7 @@ public interface IReadRepositoryBase<T> where T : class
9496
/// </summary>
9597
/// <typeparam name="TResult">The type of the value returned by the projection.</typeparam>
9698
/// <param name="specification">The encapsulated query logic.</param>
99+
/// <param name="cancellationToken">The cancellation token.</param>
97100
/// <returns>
98101
/// A task that represents the asynchronous operation.
99102
/// The task result contains a <see cref="List{TResult}" /> that contains elements from the input sequence.
@@ -105,6 +108,7 @@ public interface IReadRepositoryBase<T> where T : class
105108
/// of the <paramref name="specification"/>.
106109
/// </summary>
107110
/// <param name="specification">The encapsulated query logic.</param>
111+
/// <param name="cancellationToken">The cancellation token.</param>
108112
/// <returns>
109113
/// A task that represents the asynchronous operation. The task result contains the
110114
/// number of elements in the input sequence.
@@ -114,6 +118,7 @@ public interface IReadRepositoryBase<T> where T : class
114118
/// <summary>
115119
/// Returns the total number of records.
116120
/// </summary>
121+
/// <param name="cancellationToken">The cancellation token.</param>
117122
/// <returns>
118123
/// A task that represents the asynchronous operation. The task result contains the
119124
/// number of elements in the input sequence.
@@ -125,6 +130,7 @@ public interface IReadRepositoryBase<T> where T : class
125130
/// of the <paramref name="specification"/> or not.
126131
/// </summary>
127132
/// <param name="specification">The encapsulated query logic.</param>
133+
/// <param name="cancellationToken">The cancellation token.</param>
128134
/// <returns>
129135
/// A task that represents the asynchronous operation. The task result contains true if the
130136
/// source sequence contains any elements; otherwise, false.
@@ -134,14 +140,15 @@ public interface IReadRepositoryBase<T> where T : class
134140
/// <summary>
135141
/// Returns a boolean whether any entity exists or not.
136142
/// </summary>
143+
/// <param name="cancellationToken">The cancellation token.</param>
137144
/// <returns>
138145
/// A task that represents the asynchronous operation. The task result contains true if the
139146
/// source sequence contains any elements; otherwise, false.
140147
/// </returns>
141148
Task<bool> AnyAsync(CancellationToken cancellationToken = default);
142149

143150

144-
#if NET6_0_OR_GREATER
151+
#if NET8_0_OR_GREATER
145152
/// <summary>
146153
/// Finds all entities of <typeparamref name="T" />, that matches the encapsulated query logic of the
147154
/// <paramref name="specification"/>, from the database.

0 commit comments

Comments
 (0)