< Summary

Information
Class: Pozitron.QuerySpecification.IgnoreAutoIncludesEvaluator
Assembly: Pozitron.QuerySpecification.EntityFrameworkCore
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification.EntityFrameworkCore/Evaluators/IgnoreAutoIncludesEvaluator.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/IgnoreAutoIncludesEvaluator.cs

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