< Summary

Information
Class: Elsa.Common.Entities.OrderDefinition<T1, T2>
Assembly: Elsa.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Entities/OrderDefinition.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 37
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
.ctor()100%11100%
.ctor(...)100%11100%
get_Direction()100%11100%
get_KeySelector()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Entities/OrderDefinition.cs

#LineLine coverage
 1using System.Linq.Expressions;
 2using System.Text.Json.Serialization;
 3
 4namespace Elsa.Common.Entities;
 5
 6/// <summary>
 7/// Represents the order by which to order the results of a query.
 8/// </summary>
 9public class OrderDefinition<T, TProp>
 10{
 11    /// <summary>
 12    /// Creates a new instance of the <see cref="OrderDefinition{T, TProp}"/> class.
 13    /// </summary>
 24814    public OrderDefinition()
 15    {
 24816    }
 17
 18    /// <summary>
 19    /// Creates a new instance of the <see cref="OrderDefinition{T, TProp}"/> class.
 20    /// </summary>
 882821    public OrderDefinition(Expression<Func<T, TProp>> keySelector, OrderDirection direction)
 22    {
 882823        KeySelector = keySelector;
 882824        Direction = direction;
 882825    }
 26
 27    /// <summary>
 28    /// The direction in which to order the results.
 29    /// </summary>
 1816630    public OrderDirection Direction { get; set; }
 31
 32    /// <summary>
 33    /// The key selector to use to order the results.
 34    /// </summary>
 35    [JsonIgnore]
 1815836    public Expression<Func<T, TProp>> KeySelector { get; set; } = null!;
 37}