< Summary

Information
Class: Pozitron.QuerySpecification.IgnoreQueryFiltersEvaluator
Assembly: Pozitron.QuerySpecification.EntityFrameworkCore
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification.EntityFrameworkCore/Evaluators/IgnoreQueryFiltersEvaluator.cs
Tag: 52_11740816328
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 25
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 Crap Score Cyclomatic complexity Line 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>
 6public sealed class IgnoreQueryFiltersEvaluator : IEvaluator
 7{
 8
 9    /// <summary>
 10    /// Gets the singleton instance of the <see cref="IgnoreQueryFiltersEvaluator"/> class.
 11    /// </summary>
 112    public static IgnoreQueryFiltersEvaluator Instance = new();
 213    private IgnoreQueryFiltersEvaluator() { }
 14
 15    /// <inheritdoc/>
 16    public IQueryable<T> Evaluate<T>(IQueryable<T> source, Specification<T> specification) where T : class
 17    {
 5218        if (specification.IgnoreQueryFilters)
 19        {
 1120            source = source.IgnoreQueryFilters();
 21        }
 22
 5223        return source;
 24    }
 25}