< Summary

Information
Class: Pozitron.QuerySpecification.OrderExpressionCompiled<T>
Assembly: Pozitron.QuerySpecification
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Expressions/OrderExpression.cs
Tag: 52_11740816328
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 61
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_KeySelector()100%11100%
get_Type()100%11100%
.ctor(...)100%11100%

File(s)

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

#LineLine coverage
 1using System.Diagnostics;
 2
 3namespace Pozitron.QuerySpecification;
 4
 5/// <summary>
 6/// Represents an order expression used in a specification.
 7/// </summary>
 8/// <typeparam name="T">The type of the entity.</typeparam>
 9public sealed class OrderExpression<T>
 10{
 11    /// <summary>
 12    /// Gets the key selector expression.
 13    /// </summary>
 14    public Expression<Func<T, object?>> KeySelector { get; }
 15
 16    /// <summary>
 17    /// Gets the type of the order.
 18    /// </summary>
 19    public OrderType Type { get; }
 20
 21    /// <summary>
 22    /// Initializes a new instance of the <see cref="OrderExpression{T}"/> class.
 23    /// </summary>
 24    /// <param name="keySelector">The key selector expression.</param>
 25    /// <param name="type">The type of the order.</param>
 26    public OrderExpression(Expression<Func<T, object?>> keySelector, OrderType type)
 27    {
 28        Debug.Assert(keySelector is not null);
 29        KeySelector = keySelector;
 30        Type = type;
 31    }
 32}
 33
 34/// <summary>
 35/// Represents a compiled order expression used in a specification.
 36/// </summary>
 37/// <typeparam name="T">The type of the entity.</typeparam>
 38public sealed class OrderExpressionCompiled<T>
 39{
 40    /// <summary>
 41    /// Gets the compiled key selector function.
 42    /// </summary>
 243    public Func<T, object?> KeySelector { get; }
 44
 45    /// <summary>
 46    /// Gets the type of the order.
 47    /// </summary>
 248    public OrderType Type { get; }
 49
 50    /// <summary>
 51    /// Initializes a new instance of the <see cref="OrderExpressionCompiled{T}"/> class.
 52    /// </summary>
 53    /// <param name="keySelector">The compiled key selector function.</param>
 54    /// <param name="type">The type of the order.</param>
 255    public OrderExpressionCompiled(Func<T, object?> keySelector, OrderType type)
 56    {
 57        Debug.Assert(keySelector is not null);
 258        KeySelector = keySelector;
 259        Type = type;
 260    }
 61}