< Summary

Information
Class: Pozitron.QuerySpecification.QueryTagEvaluator
Assembly: Pozitron.QuerySpecification.EntityFrameworkCore
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification.EntityFrameworkCore/Evaluators/QueryTagEvaluator.cs
Tag: 67_15587897385
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 29
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.cctor()100%11100%
.ctor()100%11100%
Evaluate(...)100%66100%

File(s)

/home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification.EntityFrameworkCore/Evaluators/QueryTagEvaluator.cs

#LineLine coverage
 1namespace Pozitron.QuerySpecification;
 2
 3/// <summary>
 4/// Evaluator to apply the query tags to the query.
 5/// </summary>
 6[EvaluatorDiscovery(Order = 60)]
 7public sealed class QueryTagEvaluator : IEvaluator
 8{
 9
 10    /// <summary>
 11    /// Gets the singleton instance of the <see cref="QueryTagEvaluator"/> class.
 12    /// </summary>
 213    public static QueryTagEvaluator Instance = new();
 414    private QueryTagEvaluator() { }
 15
 16    /// <inheritdoc/>
 17    public IQueryable<T> Evaluate<T>(IQueryable<T> source, Specification<T> specification) where T : class
 18    {
 60419        foreach (var item in specification.Items)
 20        {
 24621            if (item.Type == ItemType.QueryTag && item.Reference is string tag)
 22            {
 1323                source = source.TagWith(tag);
 24            }
 25        }
 26
 5627        return source;
 28    }
 29}