< Summary

Information
Class: Pozitron.QuerySpecification.WhereExpressionCompiled<T>
Assembly: Pozitron.QuerySpecification
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Expressions/WhereExpression.cs
Tag: 52_11740816328
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 47
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Filter()100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Expressions/WhereExpression.cs

#LineLine coverage
 1using System.Diagnostics;
 2
 3namespace Pozitron.QuerySpecification;
 4
 5/// <summary>
 6/// Represents a where expression used in a specification.
 7/// </summary>
 8/// <typeparam name="T">The type of the entity.</typeparam>
 9public sealed class WhereExpression<T>
 10{
 11    /// <summary>
 12    /// Gets the filter expression.
 13    /// </summary>
 14    public Expression<Func<T, bool>> Filter { get; }
 15
 16    /// <summary>
 17    /// Initializes a new instance of the <see cref="WhereExpression{T}"/> class.
 18    /// </summary>
 19    /// <param name="filter">The filter expression.</param>
 20    public WhereExpression(Expression<Func<T, bool>> filter)
 21    {
 22        Debug.Assert(filter is not null);
 23        Filter = filter;
 24    }
 25}
 26
 27/// <summary>
 28/// Represents a compiled where expression used in a specification.
 29/// </summary>
 30/// <typeparam name="T">The type of the entity.</typeparam>
 31public sealed class WhereExpressionCompiled<T>
 32{
 33    /// <summary>
 34    /// Gets the compiled filter function.
 35    /// </summary>
 136    public Func<T, bool> Filter { get; }
 37
 38    /// <summary>
 39    /// Initializes a new instance of the <see cref="WhereExpressionCompiled{T}"/> class.
 40    /// </summary>
 41    /// <param name="filter">The compiled filter function.</param>
 142    public WhereExpressionCompiled(Func<T, bool> filter)
 43    {
 44        Debug.Assert(filter is not null);
 145        Filter = filter;
 146    }
 47}