< Summary

Information
Class: Pozitron.QuerySpecification.AsSplitQueryEvaluator
Assembly: Pozitron.QuerySpecification.EntityFrameworkCore
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification.EntityFrameworkCore/Evaluators/AsSplitQueryEvaluator.cs
Tag: 52_11740816328
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 24
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/AsSplitQueryEvaluator.cs

#LineLine coverage
 1namespace Pozitron.QuerySpecification;
 2
 3/// <summary>
 4/// Evaluator to apply AsSplitQuery to the query if the specification has AsSplitQuery set to true.
 5/// </summary>
 6public sealed class AsSplitQueryEvaluator : IEvaluator
 7{
 8    /// <summary>
 9    /// Gets the singleton instance of the <see cref="AsSplitQueryEvaluator"/> class.
 10    /// </summary>
 111    public static AsSplitQueryEvaluator Instance = new();
 212    private AsSplitQueryEvaluator() { }
 13
 14    /// <inheritdoc/>
 15    public IQueryable<T> Evaluate<T>(IQueryable<T> source, Specification<T> specification) where T : class
 16    {
 5217        if (specification.AsSplitQuery)
 18        {
 319            source = source.AsSplitQuery();
 20        }
 21
 5222        return source;
 23    }
 24}