Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Ardalis.Specification.EntityFrameworkCore;

public class TagWithEvaluator : IEvaluator
public class QueryTagEvaluator : IEvaluator
{
private TagWithEvaluator() { }
public static TagWithEvaluator Instance { get; } = new TagWithEvaluator();
private QueryTagEvaluator() { }
public static QueryTagEvaluator Instance { get; } = new QueryTagEvaluator();

public bool IsCriteriaEvaluator { get; } = true;

Expand All @@ -15,8 +15,7 @@ public IQueryable<T> GetQuery<T>(IQueryable<T> query, ISpecification<T> specific

if (spec.OneOrManyQueryTags.HasSingleItem)
{
query = query.TagWith(spec.OneOrManyQueryTags.Single);
return query;
return query.TagWith(spec.OneOrManyQueryTags.Single);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public SpecificationEvaluator()
IgnoreQueryFiltersEvaluator.Instance,
IgnoreAutoIncludesEvaluator.Instance,
AsSplitQueryEvaluator.Instance,
TagWithEvaluator.Instance,
QueryTagEvaluator.Instance,
];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Tests.Evaluators;

[Collection("SharedCollection")]
public class TagWithEvaluatorTests(TestFactory factory) : IntegrationTest(factory)
public class QueryTagEvaluatorTests(TestFactory factory) : IntegrationTest(factory)
{
private static readonly TagWithEvaluator _evaluator = TagWithEvaluator.Instance;
private static readonly QueryTagEvaluator _evaluator = QueryTagEvaluator.Instance;

[Fact]
public void QueriesMatch_GivenTag()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public void DerivedSpecificationEvaluatorCanAlterDefaultEvaluator()
result[10].Should().BeOfType<IgnoreQueryFiltersEvaluator>();
result[11].Should().BeOfType<IgnoreAutoIncludesEvaluator>();
result[12].Should().BeOfType<AsSplitQueryEvaluator>();
result[13].Should().BeOfType<TagWithEvaluator>();
result[13].Should().BeOfType<QueryTagEvaluator>();
result[14].Should().BeOfType<WhereEvaluator>();
}

Expand Down