@@ -26,8 +26,6 @@ public class Specification<T, TResult> : Specification<T>, ISpecification<T, TRe
2626/// <inheritdoc cref="ISpecification{T}"/>
2727public class Specification < T > : ISpecification < T >
2828{
29- private const int DEFAULT_CAPACITY_SEARCH = 2 ;
30-
3129 // It is utilized only during the building stage for the sub-chains. Once the state is built, we don't care about it anymore.
3230 // The initial value is not important since the value is always initialized by the root of the chain.
3331 // Therefore, we don't need ThreadLocal (it's more expensive).
@@ -43,8 +41,8 @@ public class Specification<T> : ISpecification<T>
4341 private OneOrMany < OrderExpressionInfo < T > > _orderExpressions = new ( ) ;
4442 private OneOrMany < IncludeExpressionInfo > _includeExpressions = new ( ) ;
4543 private OneOrMany < string > _includeStrings = new ( ) ;
46- private Dictionary < string , object > ? _items ;
4744 private OneOrMany < string > _queryTags = new ( ) ;
45+ private Dictionary < string , object > ? _items ;
4846
4947 public ISpecificationBuilder < T > Query => new SpecificationBuilder < T > ( this ) ;
5048 protected virtual IInMemorySpecificationEvaluator Evaluator => InMemorySpecificationEvaluator . Default ;
@@ -88,15 +86,6 @@ public class Specification<T> : ISpecification<T>
8886 /// <inheritdoc/>
8987 public bool AsNoTrackingWithIdentityResolution { get ; internal set ; } = false ;
9088
91-
92- // Specs are not intended to be thread-safe, so we don't need to worry about thread-safety here.
93- internal void Add ( WhereExpressionInfo < T > whereExpression ) => _whereExpressions . Add ( whereExpression ) ;
94- internal void Add ( OrderExpressionInfo < T > orderExpression ) => _orderExpressions . Add ( orderExpression ) ;
95- internal void Add ( IncludeExpressionInfo includeExpression ) => _includeExpressions . Add ( includeExpression ) ;
96- internal void Add ( string includeString ) => _includeStrings . Add ( includeString ) ;
97- internal void Add ( SearchExpressionInfo < T > searchExpression ) => _searchExpressions . AddSorted ( searchExpression , SearchExpressionComparer < T > . Default ) ;
98- internal void AddQueryTag ( string queryTag ) => _queryTags . Add ( queryTag ) ;
99-
10089 /// <inheritdoc/>
10190 public Dictionary < string , object > Items => _items ??= [ ] ;
10291
@@ -118,13 +107,6 @@ public class Specification<T> : ISpecification<T>
118107 /// <inheritdoc/>
119108 public IEnumerable < string > QueryTags => _queryTags . Values ;
120109
121- internal OneOrMany < WhereExpressionInfo < T > > OneOrManyWhereExpressions => _whereExpressions ;
122- internal OneOrMany < SearchExpressionInfo < T > > OneOrManySearchExpressions => _searchExpressions ;
123- internal OneOrMany < OrderExpressionInfo < T > > OneOrManyOrderExpressions => _orderExpressions ;
124- internal OneOrMany < IncludeExpressionInfo > OneOrManyIncludeExpressions => _includeExpressions ;
125- internal OneOrMany < string > OneOrManyIncludeStrings => _includeStrings ;
126- internal OneOrMany < string > OneOrManyQueryTags => _queryTags ;
127-
128110 /// <inheritdoc/>
129111 public virtual IEnumerable < T > Evaluate ( IEnumerable < T > entities )
130112 {
@@ -139,6 +121,20 @@ public virtual bool IsSatisfiedBy(T entity)
139121 return validator . IsValid ( entity , this ) ;
140122 }
141123
124+ internal OneOrMany < WhereExpressionInfo < T > > OneOrManyWhereExpressions => _whereExpressions ;
125+ internal OneOrMany < SearchExpressionInfo < T > > OneOrManySearchExpressions => _searchExpressions ;
126+ internal OneOrMany < OrderExpressionInfo < T > > OneOrManyOrderExpressions => _orderExpressions ;
127+ internal OneOrMany < IncludeExpressionInfo > OneOrManyIncludeExpressions => _includeExpressions ;
128+ internal OneOrMany < string > OneOrManyIncludeStrings => _includeStrings ;
129+ internal OneOrMany < string > OneOrManyQueryTags => _queryTags ;
130+
131+ internal void Add ( WhereExpressionInfo < T > whereExpression ) => _whereExpressions . Add ( whereExpression ) ;
132+ internal void Add ( SearchExpressionInfo < T > searchExpression ) => _searchExpressions . AddSorted ( searchExpression , SearchExpressionComparer < T > . Default ) ;
133+ internal void Add ( OrderExpressionInfo < T > orderExpression ) => _orderExpressions . Add ( orderExpression ) ;
134+ internal void Add ( IncludeExpressionInfo includeExpression ) => _includeExpressions . Add ( includeExpression ) ;
135+ internal void Add ( string includeString ) => _includeStrings . Add ( includeString ) ;
136+ internal void AddQueryTag ( string queryTag ) => _queryTags . Add ( queryTag ) ;
137+
142138 internal Specification < T > Clone ( )
143139 {
144140 var newSpec = new Specification < T > ( ) ;
0 commit comments