< Summary

Information
Class: Pozitron.QuerySpecification.WhereEvaluator
Assembly: Pozitron.QuerySpecification
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Evaluators/WhereEvaluator.cs
Tag: 44_11195777782
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 27
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
.cctor()100%11100%
Evaluate(...)100%22100%
Evaluate(...)100%22100%

File(s)

/home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Evaluators/WhereEvaluator.cs

#LineLine coverage
 1namespace Pozitron.QuerySpecification;
 2
 3public class WhereEvaluator : IEvaluator, IInMemoryEvaluator
 4{
 45    private WhereEvaluator() { }
 26    public static WhereEvaluator Instance = new();
 7
 8    public IQueryable<T> Evaluate<T>(IQueryable<T> source, Specification<T> specification) where T : class
 9    {
 21010        foreach (var whereExpression in specification.WhereExpressions)
 11        {
 5512            source = source.Where(whereExpression.Filter);
 13        }
 14
 5015        return source;
 16    }
 17
 18    public IEnumerable<T> Evaluate<T>(IEnumerable<T> source, Specification<T> specification)
 19    {
 4220        foreach (var whereExpression in specification.WhereExpressions)
 21        {
 722            source = source.Where(whereExpression.FilterFunc);
 23        }
 24
 1425        return source;
 26    }
 27}