< Summary

Information
Class: Pozitron.QuerySpecification.IgnoreQueryFiltersEvaluator
Assembly: Pozitron.QuerySpecification.EntityFrameworkCore
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification.EntityFrameworkCore/Evaluators/IgnoreQueryFiltersEvaluator.cs
Tag: 67_15587897385
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 26
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
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%22100%

File(s)

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

#LineLine coverage
 1namespace Pozitron.QuerySpecification;
 2
 3/// <summary>
 4/// Evaluator to apply IgnoreQueryFilters to the query if the specification has IgnoreQueryFilters set to true.
 5/// </summary>
 6[EvaluatorDiscovery(Order = 80)]
 7public sealed class IgnoreQueryFiltersEvaluator : IEvaluator
 8{
 9
 10    /// <summary>
 11    /// Gets the singleton instance of the <see cref="IgnoreQueryFiltersEvaluator"/> class.
 12    /// </summary>
 213    public static IgnoreQueryFiltersEvaluator Instance = new();
 414    private IgnoreQueryFiltersEvaluator() { }
 15
 16    /// <inheritdoc/>
 17    public IQueryable<T> Evaluate<T>(IQueryable<T> source, Specification<T> specification) where T : class
 18    {
 5219        if (specification.IgnoreQueryFilters)
 20        {
 1121            source = source.IgnoreQueryFilters();
 22        }
 23
 5224        return source;
 25    }
 26}